【发布时间】:2012-08-28 05:45:47
【问题描述】:
100 >= 99.2 怎么可能是假的?
var ls = parseFloat(("100").replace(",", ".")).toFixed(1);
var val = parseFloat(("99,2").replace(",", ".")).toFixed(1);
alert(ls >= val); /*=> result is false ...but it should be true */
ui文化是nl-BE
jsfiddle:http://jsfiddle.net/Ed6VY/
【问题讨论】:
标签: javascript floating-point compare