Currency represents a local currency amount that can be formatted using the Intl apis.
Intl
Optional
Static
Returns a new Decimal that is the sum of this and x.
Decimal
x
let a = decimal('50000000000')let b = decimal('0.000000005')a.add(b) // 50000000000.000000005
Returns a new copy of this Decimal value.
Returns a comparison value representing the ordering of this value in respect to x.
-1
1
0
Returns a new Decimal that is the quotient of this and x
let a = decimal('1')let b = decimal('3')a.div(b) // 0.333333333333333333333333333333
Returns true if this value is equal to the value of x, otherwise false.
true
false
other
Returns true if this value is greater than the value of x, otherwise false.
Returns true if this value is greater than or equal to the value of x, otherwise false.
Returns true if this value is less than the value of x, otherwise false.
Returns true if this value is less than or equal to the value of x, otherwise false.
Returns a new Decimal that is the product of this and x.
let a = decimal('0.0000000000000000000025')let b = decimal('400000000000000000000')a.mul(b) // 1
Returns a new Decimal that has the opposite sign of this Decimal.
let a = decimal('5')a.negated() // -5
Returns the square root of this Decimal.
Returns a new Decimal that is the difference between this and x.
let a = decimal('1')let b = decimal('0.0000000000000000001')a.sub(b) // 0.9999999999999999999
Converts this decimal to the Number value
Number
Returns a string representation of this decimal.
Generated using TypeDoc
Currency represents a local currency amount that can be formatted using the
Intl
apis.