sanniassin / react-input-mask

Input masking component for React. Made with attention to UX.
MIT License
2.22k stars 257 forks source link

I have created a numeric mask with 17 position '99999999999999999' but somehow it is not working properly. #243

Open sk81308 opened 3 years ago

sk81308 commented 3 years ago

For example, I have created a mask '99999999999999999' e input the data '11111111111111111', and the result is '11111111111111112'

It only happens when my numeric mask is greater than 16 positions.

Is there any limitation in relation to the size of the mask?

varoot commented 3 years ago

Did you store the data as string or did you convert it to number? JavaScript can only handle around 15-digit precision for Number so the bug might be there