1015 B
1015 B
Functions
hexToBn
▸ hexToBn(value?: string | number | null, options?: ToBnOptions | boolean): BN
Defined in hex/toBn.ts:35
name: hexToBn
summary: Creates a BN.js bignumber object from a hex string.
description: null inputs returns a BN(0) result. Hex input values return the actual value converted to a BN. Anything that is not a hex string (including the 0x prefix) throws an error.
example:
import { hexToBn } from '@polkadot/util';
hexToBn('0x123480001f'); // => BN(0x123480001f)
Parameters:
| Name | Type | Default value |
|---|---|---|
Optional value |
string |
number |
Default value options |
ToBnOptions | boolean |
Returns: BN