Skip to main content

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

NameType
numstring | NormalizedNumber
prefixUnitPrefix

Returns

PrefixedNumber

Defined in

numbers.ts:260

Properties

_prefix

Private Readonly _prefix: UnitPrefix

Defined in

numbers.ts:258


_scientificNumber

Private Readonly _scientificNumber: ScientificNumber

Defined in

numbers.ts:257


ZERO

Static ZERO: PrefixedNumber

Defined in

numbers.ts:255

Accessors

coefficient

get coefficient(): NormalizedNumber

Returns

NormalizedNumber

Defined in

numbers.ts:280


prefix

get prefix(): UnitPrefix

Returns

UnitPrefix

Defined in

numbers.ts:270


scientificNumber

get scientificNumber(): ScientificNumber

Returns

ScientificNumber

Defined in

numbers.ts:307

Methods

add

add(other): PrefixedNumber

Parameters

NameType
otherPrefixedNumber

Returns

PrefixedNumber

Defined in

numbers.ts:296


convertTo

convertTo(prefix): PrefixedNumber

Parameters

NameType
prefixUnitPrefix

Returns

PrefixedNumber

Defined in

numbers.ts:265


isNegative

isNegative(): boolean

Returns

boolean

Defined in

numbers.ts:292


negate

negate(): PrefixedNumber

Returns

PrefixedNumber

Defined in

numbers.ts:288


optimizeScale

optimizeScale(maxDigits): PrefixedNumber

Parameters

NameType
maxDigitsnumber

Returns

PrefixedNumber

Defined in

numbers.ts:274


subtract

subtract(other): PrefixedNumber

Parameters

NameType
otherPrefixedNumber

Returns

PrefixedNumber

Defined in

numbers.ts:303


toNumber

toNumber(): number

Returns

number

Defined in

numbers.ts:284