@easymoney/bigint-money
TypeScript icon, indicating that this package has built-in type declarations

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

/@easymoney/bigint-money/

    Package Sidebar

    Install

    npm i @easymoney/bigint-money

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    110 kB

    Total Files

    28

    Last publish

    Collaborators

    • whispers12