RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.36k stars 2.18k forks source link

Incorrect validation when using a decimal mask #2792

Open skrasnoyarov opened 1 month ago

skrasnoyarov commented 1 month ago

@RobinHerbots Hello! I use decimal mask with an unlimited number of decimal places. To validate the value, I use Inputmask.isValid and when entering 16 or 17 digits after the decimal point, the isValid function returns false. Is this a bug?

Example

Thank`s for your attention!

Techn1c4l commented 1 month ago

Do you really need that high number precision? JavaScript uses double-precision floating point which follows IEEE 754 with limitation of 64-bit precision (16 digits), so you can't expect it to work correctly when you have that many digits.

skrasnoyarov commented 1 month ago

@Techn1c4l Hi. Thank you. I set the limit to 16 digits