Reputation: 453
We have a simple input field with the type number. When we display large numbers the value that is visible in the element is different to the one that is in the field. This only happens on firefox (testet with version 30.0).
If I have following code the value written in html is 9999999999999999 but firefox displays 10000000000000000.
<input type="number" min="0" max="9999999999999999" value="9999999999999999">
Is there any solution to show a numeric input field on mobile devices without the type number or solve this problem?
Upvotes: 1
Views: 628
Reputation: 11245
Just try fiddle
in FF and Chrome:
alert(9999999999999999);//return 10000000000000000
alert(999999999999999);//return 999999999999999
I think it's a IEEE 754 spec "feature" (like 0.1 + 0.2
). Try IEEE 754 converter and you will see why result was changed.
Upvotes: 1