Neutron Polarization Manipulator
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@easymoney/bigint-money

1.0.1 • Public • Published

easy money logo

@easymoney/bigint-money

npm-bigint-money npm type definitions deps-bigint-money size-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
 

Install

npm i @easymoney/bigint-money

DownloadsWeekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

110 kB

Total Files

28

Last publish

Collaborators

  • avatar