Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

tofixed javascript

var val = (parseFloat('2.3') + parseFloat('2.4')).toFixed(2)
//if you are adding dynamic values then use following example
var a = 2.3;
var b = 2.4;
var val = (parseFloat(a)+parseFloat(b)).toFixed(2);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #tofixed #javascript
ADD COMMENT
Topic
Name
8+5 =