-
Notifications
You must be signed in to change notification settings - Fork 160
Description
When handling currency values in programming it's recommended to use integer values to avoid calculations and conversion mistakes due to the floating point problem.
So I want to discuss the possibility to have a prop called something like parseAsInteger so the value will be an integer, with the decimals multiplied by their precision.
So when the user input: 12,34 the value should be 1234, if the precision is 2.
If the precision is other like 3, the value 12,345 should be parsed as 12345.
Instead of having to multiply it by 100 by my self I would like to have the value parsed as integer like this.
For instance: 2.22 * 100 == 222 evaluates to false. When I multiply 2.22 by 100, it doesn't return an integer value due to the floating point problem.
I can make a PR but I want to have some feedback on this issue first.