Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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 bill)

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 in reply to:  description Changed 7 years ago by mm

Replying to mm:

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 ?

http://dojotoolkit.org/reference-guide/1.8/dojo/number.html#round

comment:2 Changed 7 years ago by bill

Component: GeneralDocumentation
Description: modified (diff)
Owner: set to Adam Peller
Status: newassigned

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 7 years ago by Adam Peller

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:4 Changed 7 years ago by bill

(0.9).toFixed(1) returns 0.9 even on IE6.

comment:5 Changed 7 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

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 7 years ago by Adam Peller

Milestone: tbd1.9
Note: See TracTickets for help on using tickets.