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>'+ +'</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:

[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:

Related Query

More Query from same tag