Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/web3/types/bignumber.d.ts>BigNumber.isBigNumber

Deno / TypeScript to Ethereum Connector
Latest
method BigNumber.isBigNumber
import { BigNumber } from "https://deno.land/x/web3@v0.11.1/types/bignumber.d.ts";

Returns true if value is a BigNumber instance, otherwise returns false.

If BigNumber.DEBUG is true, throws if a BigNumber instance is not well-formed.

x = 42
y = new BigNumber(x)

BigNumber.isBigNumber(x)             // false
y instanceof BigNumber               // true
BigNumber.isBigNumber(y)             // true

BN = BigNumber.clone();
z = new BN(x)
z instanceof BigNumber               // false
BigNumber.isBigNumber(z)             // true

Parameters

value: any

The value to test.