@bitzlato/money-js
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -62,13 +62,13 @@ 'use strict'; | ||
assertSameCurrency(this, money); | ||
return new Money(this.amount.plus(money.amount), this.currency); | ||
return new Money(this.amount.plus(money.amount), this.currency, this.roundingMode); | ||
} | ||
subtract(money) { | ||
assertSameCurrency(this, money); | ||
return new Money(this.amount.minus(money.amount), this.currency); | ||
return new Money(this.amount.minus(money.amount), this.currency, this.roundingMode); | ||
} | ||
multiply(multiplier) { | ||
return new Money(this.amount.times(multiplier), this.currency); | ||
return new Money(this.amount.times(multiplier), this.currency, this.roundingMode); | ||
} | ||
divide(divisor) { | ||
return new Money(this.amount.div(divisor), this.currency); | ||
return new Money(this.amount.div(divisor), this.currency, this.roundingMode); | ||
} | ||
@@ -75,0 +75,0 @@ compare(money) { |
@@ -56,13 +56,13 @@ import Big from 'big.js'; | ||
assertSameCurrency(this, money); | ||
return new Money(this.amount.plus(money.amount), this.currency); | ||
return new Money(this.amount.plus(money.amount), this.currency, this.roundingMode); | ||
} | ||
subtract(money) { | ||
assertSameCurrency(this, money); | ||
return new Money(this.amount.minus(money.amount), this.currency); | ||
return new Money(this.amount.minus(money.amount), this.currency, this.roundingMode); | ||
} | ||
multiply(multiplier) { | ||
return new Money(this.amount.times(multiplier), this.currency); | ||
return new Money(this.amount.times(multiplier), this.currency, this.roundingMode); | ||
} | ||
divide(divisor) { | ||
return new Money(this.amount.div(divisor), this.currency); | ||
return new Money(this.amount.div(divisor), this.currency, this.roundingMode); | ||
} | ||
@@ -69,0 +69,0 @@ compare(money) { |
{ | ||
"name": "@bitzlato/money-js", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A small library for working with monetary values", | ||
@@ -31,10 +31,10 @@ "author": "Maksim Gerasimov <treizeger@gmail.com> (http://github.com/trzmaxim)", | ||
"devDependencies": { | ||
"@swc/core": "^1.2.102", | ||
"@swc/jest": "^0.2.5", | ||
"@types/jest": "^27.0.2", | ||
"jest": "^27.3.1", | ||
"@swc/core": "^1.2.121", | ||
"@swc/jest": "^0.2.15", | ||
"@types/jest": "^27.0.3", | ||
"jest": "^27.4.5", | ||
"rollup": "^1.29.0", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"typescript": "^4.4.4" | ||
"rollup-plugin-typescript2": "^0.31.1", | ||
"typescript": "^4.5.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18584