Skip to main content

Using NumberPicker

Supporting High Precision

When the precision requirements for the NumberPicker component are very high, for example, if decimal places need to be accurate to more than ten digits, or if the number itself is frequently very large (e.g., exceeding ten digits), such as the following ultra-high precision large number:

1234567890123456789.123456789012345678

Browsers cannot handle such ultra-high precision numbers. Representing them directly as a number type will result in precision loss. For instance, as shown in the image below, directly adding one to the number above in the browser causes all decimal values to be lost, and some integer digits are also lost:

number-lose-accuracy

The NumberPicker component is based on the browser's native support for numbers, and therefore, it also cannot support such high-precision numbers.

In such cases, you must use another component: the high-precision number component NumericPicker. This component supports numbers of arbitrary precision and size.

API

The complete NumberPicker API reference can be found here: NumberPicker