-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect intValue #365
Comments
This one is a bit tricky, the Here's how it's currently documented: var currencyRounding = value => currency(value, { increment: .05 });
currencyRounding(1.09); // => { intValue: 109, value: 1.09 }
currencyRounding(1.09).format(); // => "1.10"
currencyRounding(1.06); // => { intValue: 106, value: 1.06 }
currencyRounding(1.06).format(); // => "1.05" While not ideal, one way to work around this is to pass the resulting value back into another currency value: var currencyRounding = currency(1.03, { increment: .05 });
var currencyValue = currency(currencyRounding.format())
currencyValue.intValue; // 105 I could see something like this changing, but it would need a non-breaking proposal. |
i see. at least this work. thanks!! |
Shouldn't the
result.intValue
is 1000?How do I get the result of the rounding in int value correctly?
The text was updated successfully, but these errors were encountered: