How can we convert a JavaScript string variable to decimal?(如何将JavaScript字符串变量转换为十进制?)
parseInt(document.getElementById(amtid4).innerHTML)
Yes -- parseFloat .(是的– parseFloat 。)
parseFloat
parseFloat(document.getElementById(amtid4).innerHTML);
toFixed
var num = parseFloat(document.getElementById(amtid4).innerHTML).toFixed(2);
num
1.4m articles
1.4m replys
5 comments
56.9k users