#16546 closed defect (fixed)
dojo/number#round documentation
Reported by: | mm | Owned by: | Adam Peller |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | Documentation | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Both reference guide and live docs have wrong code:
// Outputs "0.0" in IE // Outputs "1.0" in other browsers console.log((0.9).toFixed(1));
are you really sure this is true ?
Change History (6)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Component: | General → Documentation |
---|---|
Description: | modified (diff) |
Owner: | set to Adam Peller |
Status: | new → assigned |
That's from peller's original checkin of that doc page. IE return 0.9 for me, not 0.0. Didn't try other browsers.
comment:3 Changed 8 years ago by
I think IE finally fixed the bug, so we should update the docs to reflect that, but it was true for an embarrassingly long time (through IE8 IIRC). Bill, what version did you try?
comment:5 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
ok, sorry, I missed the typo. toFixed(1) should be toFixed(0) or just toFixed(). The IE bug does extend to decimals also, I think, but not sure of the details. Maybe 0.09.toFixed(1) also produces incorrect results?
I'll fix the docs.
comment:6 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|
Note: See
TracTickets for help on using
tickets.
Replying to mm:
http://dojotoolkit.org/reference-guide/1.8/dojo/number.html#round