Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#8692 closed defect (fixed)

Large integer values in CurrencyTextBox produces a rounding error

Reported by: Cormac Flynn Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.3.0b1
Keywords: currency integer Cc:
Blocked By: Blocking:


In testing dojo 1.3b, one of my unit tests fails and it seems to be a change in the behaviour of the CurrencyTextBox?.

For example, in the validation test page for v1.2.3

Enter 99999999999999999999999999999 in the field labelled euro currency (local format) fractional part is optional:. This is greater than the maximum integer value, and the field is correctly marked as being in error.

Perform the same test on the 1.3b release, or a nightly build

Upon onBlur, the field value is rounded down to 1.0 and is marked as being not in error.

Change History (7)

comment:1 Changed 13 years ago by Adam Peller

Owner: set to Douglas Hays

Rounding changes were introduced that would round this to 1.0e+29, which hopefully we can live with, except currency text box apparently drops the exponential

comment:2 Changed 13 years ago by Adam Peller

perhaps we should document a maximum value for numbertextboxes also

comment:3 Changed 13 years ago by Douglas Hays

Milestone: 1.3

Requires #8699

comment:4 Changed 13 years ago by Douglas Hays

Requires #8756

comment:5 Changed 13 years ago by Adam Peller

Ok, so I backed out the 1.3 change and now we should be only as bad off as we were in 1.2.x. Strangely, copying in that string of 9's results in a validation error, but typing it in results in formatting to "€1e,+29.00" (see #8756) At least it's not making gross rounding errors atm.

comment:6 Changed 13 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [16880]) Fixes #8756. Established default maximum Number value of 9e+15. If beyond max, then do not attempt to format to a string.

comment:7 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.