@easymoney/money
v1.0.2
Published
Best way to do money in js
Downloads
9,756
Maintainers
Readme
@easymoney/money
Install
npm install @easymoney/money
or
yarn add @easymoney/money
or
CDN
Usage
import { createMoney } from '@easymoney/money';
const money = createMoney({ amount: 100, currency: 'USD' });
const money2 = createMoney({ amount: 100, currency: 'USD' });
const result = money.add(money2);
result.getAmount();
// => 200
import { createMoney } from '@easymoney/money';
const money1 = createMoney({ amount: 100, currentcy: 'USD' });
const result = money1.multiply(6);
result.getAmount();
// => "600"