views:

6

answers:

1

I have a number Dojo control that shows numbers with 30 digits after point. It formats numbers correctly, but when the number is small enough e.g. 8e-13, control shows something like 8e-13,000000000000000000000000000000 rather than 0,000000000000800000000000000000. Apparently it fails and becomes marked as invalid. I tried to pass "round:-1" to its constraints without any result. I also have noticed that 1.0000000000008 is shown correctly in control. What could be the reason of this strange formatting? Thanks.

A: 

Dijit simply doesn't handle these cases well. It's designed for more simple cases. Exponential representation breaks the formatting routines, so numbers at the extremes simply don't work, as you've noticed. There is an option for format numbers in their exponential notation, but that's largely unimplemented.

peller