2012-09-03 60 views

回答

5

toFixed後的字符串。字符串按字符進行比較。 "9""1"之後,所以"99.2"大於"100.0"

+0

@OP;您可以使用'alert(typeof ls)'來驗證它是一個字符串的事實;' – h2ooooooo

+0

更多解釋在這裏:http://stackoverflow.com/questions/2283566/tofixed-returns-a-string-in-javascript –