JavaScript: Addding floats & formatting nicely...
I have a form in HTML that has several text boxes where the users enter numbers.
I have a textbox that is to be the sum of those numbers.
I have javascript which parses the values entered by the user to floats, adds them, and displays them in the final text box.
The problem is that if the users enter certain decimal values, I get odd answers.
For example:
Text1 = 10
Text2 = 5
Text3 = 20.52
TotalText = 35.519999999999996
How can I make TotalText show 35.52?
Thanks!