Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript int to float

var int = 10;
var float = parseFloat(int).toFixed(2);
console.log(float); // 10.00
var threedots = 8;
var float2 = parseFloat(threedots).toFixed(3);
console.log(float2); // 8.000
 
PREVIOUS NEXT
Tagged: #javascript #int #float
ADD COMMENT
Topic
Name
6+5 =