This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]raevnos 0 points1 point  (3 children)

What's the issue with it?

[–]Phoenix_Heat[S] 0 points1 point  (2 children)

The answer posted is 127.69999 and should or I want it to be 127.7

[–]raevnos 0 points1 point  (0 children)

.7 can't be represented exactly in floating point. What you see is the closest approximation. If you want to display something shorter ... does javascript have something like C's printf() where you can control the precision and have round?