<script language="javascript"> var a = "0.11"; var b = "0.2801"; var c = "1.002"; var sum1 = parseFloat(a) + parseFloat(b) + parseFloat(c); var sum2 = (parseFloat(a) + parseFloat(b) + parseFloat(c)).toFixed(4) document.write("a+b+c=" + sum1); document.write("<br/>") document.write("a+b+c=" + sum2) </script>