-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fractionless): honor decimals in fractionless amounts (#265)
Honor the configured precision, as defined by `options.decimals` or `currency` if `options.decimals = undefined`, when instatiating with `.fromFractionlessAmount()` and converting `.toFractionlessAmount()`. Fixes old behavior: ``` Money.fromFractionlessAmount(1000, 'NOK', { decimals: 3 }) => 10.000 NOK money.toFractionlessAmount() => 1000 NOK ``` To expected behavior: ``` Money.fromFractionlessAmount(1000, 'NOK', { decimals: 3 }) => 1.000 NOK money.toFractionlessAmount() => 1000 NOK ```
- Loading branch information
1 parent
4345279
commit b54eeb1
Showing
3 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters