Reference / Modules / node-api / Numbers / PrefixedNumber
Class: PrefixedNumber
node-api.Numbers.PrefixedNumber
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new PrefixedNumber(num
, prefix
): PrefixedNumber
Parameters
Name | Type |
---|---|
num | string | NormalizedNumber |
prefix | UnitPrefix |
Returns
Defined in
Properties
_prefix
• Private
Readonly
_prefix: UnitPrefix
Defined in
_scientificNumber
• Private
Readonly
_scientificNumber: ScientificNumber
Defined in
ZERO
▪ Static
ZERO: PrefixedNumber
Defined in
Accessors
coefficient
• get
coefficient(): NormalizedNumber
Returns
Defined in
prefix
• get
prefix(): UnitPrefix
Returns
Defined in
scientificNumber
• get
scientificNumber(): ScientificNumber
Returns
Defined in
Methods
add
▸ add(other
): PrefixedNumber
Parameters
Name | Type |
---|---|
other | PrefixedNumber |
Returns
Defined in
convertTo
▸ convertTo(prefix
): PrefixedNumber
Parameters
Name | Type |
---|---|
prefix | UnitPrefix |
Returns
Defined in
isNegative
▸ isNegative(): boolean
Returns
boolean
Defined in
negate
▸ negate(): PrefixedNumber
Returns
Defined in
optimizeScale
▸ optimizeScale(maxDigits
): PrefixedNumber
Parameters
Name | Type |
---|---|
maxDigits | number |
Returns
Defined in
subtract
▸ subtract(other
): PrefixedNumber
Parameters
Name | Type |
---|---|
other | PrefixedNumber |
Returns
Defined in
toNumber
▸ toNumber(): number
Returns
number