来源:Pastebin 截图:ImageJavaScript的增加0.000000002来计算
<input alt="Flyer|49.80" type="checkbox" class="price" id="cb3" name="price_3" />
<input alt="CMS|199.99" type="checkbox" class="price" id="cb1" name="price_1" />
嘿人!
也许有人可以给我一点提示,在我的来源问题。 它增加了0.000000002到我的总和,当增加49.8 + 199.99。
感谢您的任何建议!
看看这个SO问题http://stackoverflow.com/questions/744099/javascript-bigdecimal-library –
可能重复的[Javascript计算错误](http://stackoverflow.com/questions/3138793/javascript-calculation -bug) –
感谢您的回答!解决:summe = String(summe.toFixed(2)); summe = summe.replace(“。”,“,”); –