My web app has a number field that accepts arbitrarily large numbers. However, In Safari, a large number is rounded in the HTML5 number field: <input type="number>
. For example, a number "1234567890123456" is rounded to "1234567890123460". Chrome and firfox doesn't do this. Is there a way to get around this in Safari?
Asked
Active
Viewed 715 times
1

dividebyzero
- 1,243
- 2
- 9
- 17
1 Answers
1
There is no ways other than using type=text. Number input can handle only IEEE 754 double-precision numbers. It can't handle arbitrary higher precision.

int32_t
- 5,774
- 1
- 22
- 20
-
Looks like an "integer" as defined by Javascript is a 64-bit number (http://stackoverflow.com/questions/307179/what-is-javascripts-max-int-whats-the-highest-integer-value-a-number-can-go-t). So I guess I will have to use "text" type. – dividebyzero Jan 07 '13 at 11:02