Questions tagged «parsefloat»

9
Javascript解析浮点数忽略逗号后的小数
这是一个简单的场景。我想显示在我的网站上显示的两个值的减法: //Value on my websites HTML is: "75,00" var fullcost = parseFloat($("#fullcost").text()); //Value on my websites HTML is: "0,03" var auctioncost = parseFloat($("#auctioncost").text()); alert(fullcost); //Outputs: 75 alert(auctioncost); //Ouputs: 0 谁能告诉我我在做什么错?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.