currencyTextBox: places constraint fails
Hi,
in currencyTextBox (hereafter cTB), we are supposed to do constraints="{places:'3,6'}" and be able to enter a number with between 3 to 6 decimals like 1.234 or 1.2345 or 1.234567. That functionality does not work however as is shown in the attached test case. What happens is that upon entering something like 1.123456, on blur the cTB's content reverts to 1.12. It's therefore truncated to 2 dijits. if one enter 1.135689, there will be a truncation but also some upward rounding and the cTB will be set at 1.14. It seems that the cTB's precision is hard-coded at 2 decimals.
Thanks for looking into it,
JR
Change History (5)
Owner: |
set to Douglas Hays
|
Component: |
Dijit →
Core
|
Owner: |
changed from Douglas Hays to Adam Peller
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
The problem is in dojo.number._formatAbsolute
Note that maxPlaces is initialized assuming that options.places is a singular integer, but then just a few lines down, the true maxPlaces is carved out of the #,# construct for places. The code should be rearranged slightly and this problem will be fixed.
A workaround hack would be to set the constraints property {round:0.0005}