Skip to content

Commit

Permalink
fix(use bigrational to decimal in conversion system)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixtedemaupeou committed Jul 3, 2018
1 parent 152235f commit 0fa69b6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Currency extends Type {
toUnit (unit) {
if (unit && unit.currency === this.currency.code) {
return Maybe.Just({
value: Number(this.value.multiply(BigRational(unit.rate).reciprocate())).toFixed(unit.decimal_digits),
value: this.value.multiply(BigRational(unit.rate).reciprocate()).toDecimal(unit.decimal_digits),
unit: unit
})
} else { return Maybe.Nothing() }
Expand Down

0 comments on commit 0fa69b6

Please sign in to comment.