-
Notifications
You must be signed in to change notification settings - Fork 189
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
Converting between currencies with different bases returns wrong scale #477
Comments
I was verifying this issue and I found that Today, it works like that:
I was thinking about:
What do you think @sarahdayan? |
I was trying to create the algorithm for converting dinero to a same currency and my idea was to use I asked a question in MathStackExchange to verify if was possible solve the base conversion. I receive this answer in MathStackExchange by Paul Sinclair.
In the last case, is impossible to express with integers the number, almost all number he said. |
When converting between currencies with different bases (e.g., MRU and UAH), the scale is wrong. This comes from the scale calculation in
convert
.Reproduction: https://codesandbox.io/s/github/dinerojs/dinero.js/tree/main/examples/starter?file=/main.js
Discussed in #446
Originally posted by antpv October 17, 2021
I have currency rate like this: 0.0001234
How can i calculate "scale" and "amount" for dinero currency rate correctly?
The text was updated successfully, but these errors were encountered: