1.2 KiB
1.2 KiB
Functions
hexToBn
▸ hexToBn(_value?: * string | number | null, _options?: * ToBnOptions | boolean): BN
Defined in hex/toBn.ts:36
name: hexToBn
signature: hexToBn (value?: string, _options: ToBnOptions | boolean = { isLe: false, isNegative: false }): BN
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 | Description |
|---|---|---|---|
Optional _value |
string | number | null |
- | The value to convert |
Default value _options |
ToBnOptions | boolean |
{ isLe: false, isNegative: false } | Options to pass while converting |
Returns: BN