assisrafael / angular-input-masks

Opinionated input masks for AngularJS
http://assisrafael.github.io/angular-input-masks/
MIT License
963 stars 329 forks source link

For a large numbers the parser function in Number.js is causing it to round to very huge different value. #158

Open syelugam opened 8 years ago

syelugam commented 8 years ago

To be detail when a large number is entered in to the input field like 9,223,372,036,854,775,295.99 the model value is being rounded in a way it is very different number from what a actual input is and this is because of the parseFloat in parser function in Number.js. Im talking about this line below without the parseFloat the modelValue is correct but with that it will effect for large input values like above. "var actualNumber = parseFloat(modelMask.apply(valueToFormat));"

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

leandrolimasi commented 8 years ago

I find a solution for this. i'm replace all "parseFloat()" with "new BigNumber()" and work's fine.

https://github.com/MikeMcl/bignumber.js/