1.0.1 • Published 4 years ago

@easymoney/bigint-money v1.0.1

Weekly downloads
14
License
MIT
Repository
github
Last release
4 years ago

@easymoney/bigint-money

npm-bigint-money npm type definitionsdeps-bigint-money]david-bigint-moneysize-bigint-money]pho-bigint-money GitHub

Open in docs

Install

npm install @easymoney/bigint-money

or

yarn add @easymoney/bigint-money

or

CDN

Usage

import { createBigIntMoney } from "@easymoney/bigint-money";

const money = createBigIntMoney({ amount: 100n, currency: "USD" });

const money2 = createBigIntMoney({ amount: 100n, currency: "USD" });

const result = money.add(money2);

result.getAmount();
// => 200n
import { createBigIntMoney } from '@easymoney/bigint-money';

const money1 = createBigIntMoney({ amount: 100n, currency: 'USD' });

const result = money1.divide(5);

const result2 = money1.divide(1 / 2);

result.getAmount();
// ->20n

result2.getAmount();
// ->200n
1.0.1

4 years ago

1.0.1-rc.1

4 years ago

1.0.1-rc.0

4 years ago

1.0.1-rc.2

4 years ago

1.0.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago