Protected
constructorPrivate
Readonly
#cfgBN instance config.
Private
Readonly
#rawRaw value multiplied by ten power of precision.
Private
Readonly
#tensTen power of precision.
Private
#hundredPrivate
#oneThe number of decimal places
true
if the this
value is negative.
true
if the this
value is positive.
true
if the this
value is zero.
A raw BigInt value with the precision applied.
A big int string value with the this.decimals
applied.
Static
MAX_Static
ROUNDINGStatic
WEI_Static
configBN class global config.
Static
precisionBN class global precision.
Private
#percentPrivate
#toA string representing the value of this
fixed-point notation and
formatted according to the properties of the BN.config.format and
format
(if exist) objects.
A new BN whose value is the value of this
rounded to
decimals using BN_ROUNDING rounding mode.
Optional
rounding: BN_ROUNDINGA new BN whose value is the square root of this
.
RuntimeError if BN.precision
is not even number.
A new BN with the provided decimals, greater than current one, otherwise throws RuntimeError.
A new BN with the provided decimals, less than current one, otherwise throws RuntimeError.
Static
fromA new BN if value
argument is valid big int like value,
otherwise throws RuntimeError.
const oneEth = BN.fromBigInt('1000000000000000000', 18)
Optional
decimalsOrConfig: BnConfigLikeStatic
fromA new BN if value
argument is valid integer or float value,
otherwise throws RuntimeError.
const oneEth = BN.fromRaw(1, 18)
Optional
decimalsOrConfig: BnConfigLikeStatic
isStatic
maxStatic
minStatic
setSets new BnGlobalConfig config to the BN.
Generated using TypeDoc
Returns
A new BN instance.