parseFloat rounding
I have javascript function that automatically adds input fields together, but adding numbers like 1.35 + 1.35 + 1.35 gives me an output of 4.050000000000001, just as an example. How can I round the total to the second decimal instead of that long string? The input fields will have more than just the 1.35 example so I need the total to never have more than 2 points after the decimal. Here is the full working code: <html> <head> <script type="text/javascript"> function Calc(className){ var elements = document.getElementsByClassName(className); var total = 0; for(var i = 0; i < elements.length; +