Display decimal value increment properly on text object

Hi yall.

So when i add two values “98.6 + 0.1” it shows me in the text object “98.79999999999999” instead of “98.7” I tried using trunc but it does not round to 10th, only to 100th and up for some odd reason.

I think it might be a bug, but any help with be appreciated. ty

I believe this is due to issues with inaccuracies with javascript math.

You can address this by doing round((98.6+0.1)*10))/10

But I really wish JS was better at dealing with nonintegers.

With your equation i modified it to use floor, and i got better increment results. But, it skips at .5.(.1,.2,.3,.4,.6,.7,.8,.9)

Shame about the javascript inaccuracies, yeah.

After thinking this further, i could just use two variables: one for the integer portion and one for decimal, and fake it by printing “.” between them etc.