Skip to content

Amount

Extends

  • Amount

Methods

abs()

abs(): Amount;

Returns an absolute Amount.

Returns

Amount

Inherited from

Bkper.Amount.abs

cmp()

cmp(n): -1 | 0 | 1;

Compare

Parameters

ParameterType
nstring | number | Amount

Returns

-1 | 0 | 1

Inherited from

Bkper.Amount.cmp

div()

div(n): Amount;

Divide by

Parameters

ParameterType
nstring | number | Amount

Returns

Amount

Inherited from

Bkper.Amount.div

eq()

eq(n): boolean;

Equals to

Parameters

ParameterType
nstring | number | Amount

Returns

boolean

Inherited from

Bkper.Amount.eq

gt()

gt(n): boolean;

Greater than

Parameters

ParameterType
nstring | number | Amount

Returns

boolean

Inherited from

Bkper.Amount.gt

gte()

gte(n): boolean;

Greater than or equal

Parameters

ParameterType
nstring | number | Amount

Returns

boolean

Inherited from

Bkper.Amount.gte

lt()

lt(n): boolean;

Less than

Parameters

ParameterType
nstring | number | Amount

Returns

boolean

Inherited from

Bkper.Amount.lt

lte()

lte(n): boolean;

Less than or equal to

Parameters

ParameterType
nstring | number | Amount

Returns

boolean

Inherited from

Bkper.Amount.lte

minus()

minus(n): Amount;

Minus

Parameters

ParameterType
nstring | number | Amount

Returns

Amount

Inherited from

Bkper.Amount.minus

mod()

mod(n): Amount;

Modulo - the integer remainder of dividing this Amount by n.

Similar to % operator

Parameters

ParameterType
nstring | number | Amount

Returns

Amount

Inherited from

Bkper.Amount.mod

plus()

plus(n): Amount;

Sum

Parameters

ParameterType
nstring | number | Amount

Returns

Amount

Inherited from

Bkper.Amount.plus

round()

round(dp?): Amount;

Round to a maximum of dp decimal places.

Parameters

ParameterType
dp?number

Returns

Amount

Inherited from

Bkper.Amount.round

times()

times(n): Amount;

Multiply

Parameters

ParameterType
nstring | number | Amount

Returns

Amount

Inherited from

Bkper.Amount.times

toFixed()

toFixed(dp?): string;

Returns a string representing the value of this Amount in normal notation to a fixed number of decimal places dp.

Parameters

ParameterType
dp?number

Returns

string

Inherited from

Bkper.Amount.toFixed

toNumber()

toNumber(): number;

Returns a primitive number representing the value of this Amount.

Returns

number

Inherited from

Bkper.Amount.toNumber

toString()

toString(): string;

Returns a string representing the value of this Amount.

Returns

string

Inherited from

Bkper.Amount.toString