I am trying to convert numbers in following formats
0 -> 0.00
1 -> 1.00
1.1 -> 1.10
4.0 -> 4.00
But problem is its returning as string only
value = 0;
var s = Math.floor(value / 60) + "." + (value % 60 ? value % 60 : '00');
console.log(s+s); //just checking if its number
But its returning as string , I tried parseInt , but its returning only 0 . I tried ParseFloat and fixedTo(2
) , its returning as string only.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…