0.0.2 • Published 1 year ago

@durhailay/bigint-utils v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

bigint-utils

A super lightweight library to handle bigints in web3 applications.

Installation

npm install @durhailay/bigint-utils

Usage

import { BigNumber } from '@durhailay/bigint-utils'

const bn = new BigNumber(1234567891011123456789n, 18)

Multiplication

const result = bn.mul(2n)

Division

const result = bn.div(123456789n)

Get the value

const value = bn.value

Get the decimals

const decimals = bn.decimals

toNumber

const number = bn.toNumber()
// 123456789.1011123456789
0.0.2

1 year ago

0.0.1

1 year ago