Skip to content

Converting between currencies with different bases returns wrong scale #477

@sarahdayan

Description

@sarahdayan

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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions