What's wrong with javascript (toFixed) method?
What's wrong with this code?
var result = 985.toFixed(2);
And the fix is:
var result = (985).toFixed(2);
I still want to know the reason. :)
In the first example, the Javascript interpreter interprets the dot as a decimal point, because it's coming after a number.
Putting brackets around the number gets around this limitation.
精彩评论