Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add two float numbers in 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);
 
PREVIOUS NEXT
Tagged: #add #float #numbers #javascript
ADD COMMENT
Topic
Name
8+1 =