PDA

View Full Version : NumberField Bugs



chun499
2 Aug 2007, 9:12 AM
For Ext.form.NumberField,
-setting decimalPrecision to 6
-enter 4.27 in the field
the field value will become 4.426999 after blur

the problem is due to the funciton fixPrecision in NumberField

var scale = Math.pow(10, this.decimalPrecision+1);
var fixed = this.decimalPrecisionFcn(value * scale);

(value * scale) will equal to 4426999

Please check....

mystix
2 Aug 2007, 9:13 AM
8887

please read. ;)

jack.slocum
2 Aug 2007, 9:16 AM
chun, that's a JavaScript rounding error present on all platforms. We do everything when can to work around it. If you have any other suggestions please let us know.