score:2

Accepted answer

Well, I can't tell you how to prevent the floating point error from occurring in the first place, but I can tell you how to hide it from the user.

You can simply use Math.round() in your formatter function, as follows:

formatter: function() {
    return '<b>'+ this.point.name +'</b>: '+ Math.round(this.percentage) +' %';
}

You already have a formatter function; I've just added Math.round() to it.

I've updated your fiddle to demonstrate: http://jsfiddle.net/A2cVe/1/

[EDIT] You mention that the tooltip was also showing the error. There is also a separate formatter function for that. I've updated the fiddle again with both formatter functions now edited to show the expected value: http://jsfiddle.net/A2cVe/2/


Related Query

More Query from same tag