Well, I canβt say how to prevent a floating point error from occurring, but I can tell you how to hide it from the user.
You can simply use Math.round() in your formatter function, as shown below:
formatter: function() { return '<b>'+ this.point.name +'</b>: '+ Math.round(this.percentage) +' %'; }
You already have a format function; I just added Math.round() to it.
I updated your script to demonstrate: http://jsfiddle.net/A2cVe/1/
[EDIT.] . You note that the tooltip also showed an error. There is also a separate formatter function for formatter . I updated the script again using both formatting functions, which are now edited to show the expected value: http://jsfiddle.net/A2cVe/2/
source share