Closed Bug 530345 Opened 15 years ago Closed 15 years ago

Number.toFixed returns wrong values

Categories

(Firefox :: General, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 513039

People

(Reporter: bugzilla33, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2b3) Gecko/20091115 Firefox/3.6b3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2b3) Gecko/20091115 Firefox/3.6b3


Number.toFixed returns sometimes wrong values (incorect rounding)


Reproducible: Always

Steps to Reproduce:

1. run attachment

Actual Results:  

( 0.95 ) . toFixed ( 1 ) = 0.9
THOUGH
( 9.5 ) . toFixed ( 0 ) = 10


Expected Results:  

( 0.95 ) . toFixed ( 1 ) = 1.0
LIKE
( 9.5 ) . toFixed ( 0 ) = 10
Attached file source
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: