HTML5 Input Type Chrome substitutes zeros for 16 digits or more

Has anyone else encountered a problem with Chrome when using the type of number entry and the number of digits exceeds 16? In my situation, anything after the 16th digit is replaced by zero blur. This does not happen in other browsers.

<label for="some-number-input">Number Input</label>
<input type="number" name="some-number-input" id="some-number-input" />

Is there a solution for this other than changing the input type?

Thank.

+3
source share
1 answer

When the number entry is blurred, Chrome analyzes the number. According to the WHATWG standard , it must convert it to an IEEE 754 double-precision floating-point number, just like numbers are represented in JavaScript. And, like in JavaScript, there is a limit to the accuracy that these numbers can have, hence rounding .

<input type="text">.

+4

All Articles