abs()
:
Decimal
Returns a new Decimal with the absolute value of this Decimal.
add(value
:
Number)
:
Decimal
Adds a Number value to this Decimal and returns the new Decimal.
add(value
:
Decimal)
:
Decimal
Adds a Decimal value to this Decimal and returns the new Decimal.
divide(value
:
Number)
:
Decimal
Divides the specified Number value with this decimal and returns the new decimal.
divide(value
:
Decimal)
:
Decimal
Divides the specified Decimal value with this decimal and returns the new decimal.
equals(other
:
Object)
:
boolean
Compares two decimal values whether they are equivalent.
get()
:
Number
Returns the value of the Decimal as a Number.
multiply(value
:
Number)
:
Decimal
Multiples the specified Number value with this Decimal and returns the new Decimal.
multiply(value
:
Decimal)
:
Decimal
Multiples the specified Decimal value with this Decimal and returns the new Decimal.
negate()
:
Decimal
Returns a new Decimal with the negated value of this Decimal.
round(decimals
:
Number)
:
Decimal
Rounds the current value of the decimal using the specified number of decimals.
subtract(value
:
Number)
:
Decimal
Subtracts the specified Number value from this Decimal and returns the new Decimal.
subtract(value
:
Decimal)
:
Decimal
Subtracts the specified Decimal value from this Decimal and returns the new Decimal.
valueOf()
:
Object
The valueOf() method is called by the ECMAScript interpret to return the "natural" value of an object.
abs
Returns a new Decimal with the absolute value of this Decimal.
add
Adds a Number value to this Decimal and returns the new Decimal.
Parameters:
value
-
the value to add to this decimal.
Returns:
the new decimal with the value added.
add
Adds a Decimal value to this Decimal and returns the new Decimal.
Parameters:
value
-
the value to add to this decimal.
Returns:
the new decimal with the value added.
addPercent
Adds a percentage value to the current value of the
decimal. For example a value of 10 represent 10% or a value of
85 represents 85%.
Parameters:
value
-
the value to add.
Returns:
a new decimal with the added percentage value.
addPercent
Adds a percentage value to the current value of the
decimal. For example a value of 10 represent 10% or a value of
85 represents 85%.
Parameters:
value
-
the value to add.
Returns:
a new decimal with the added percentage value.
divide
Divides the specified Number value with this decimal and returns the new
decimal.
When performing the division, 34 digits precision and a rounding mode of
HALF_EVEN is used to prevent quotients with nonterminating decimal
expansions.
Parameters:
value
-
the value to use to divide this decimal.
Returns:
the new decimal.
divide
Divides the specified Decimal value with this decimal and returns the new
decimal.
When performing the division, 34 digits precision and a rounding mode of
HALF_EVEN is used to prevent quotients with nonterminating decimal
expansions.
Parameters:
value
-
the value to use to divide this decimal.
Returns:
the new decimal.
equals
equals(other
:
Object)
:
boolean
Compares two decimal values whether they are equivalent.
Parameters:
other
-
the object to comapre against this decimal.
get
Returns the value of the Decimal as a Number.
Returns:
the value of the Decimal.
hashCode
Calculates the hash code for this decimal;
multiply
Multiples the specified Number value with this Decimal and returns the new Decimal.
Parameters:
value
-
the value to multiply with this decimal.
Returns:
the new decimal.
multiply
Multiples the specified Decimal value with this Decimal and returns the new Decimal.
Parameters:
value
-
the value to multiply with this decimal.
Returns:
the new decimal.
negate
Returns a new Decimal with the negated value of this Decimal.
round
Rounds the current value of the decimal using the specified
number of decimals. The parameter
specifies the number of digest after the decimal point.
Parameters:
decimals
-
the number of decimals to use.
Returns:
the decimal that has been rounded.
subtract
Subtracts the specified Number value from this Decimal and returns the new Decimal.
Parameters:
value
-
the value to add to this decimal.
Returns:
the new decimal with the value subtraced.
subtract
Subtracts the specified Decimal value from this Decimal and returns the new Decimal.
Parameters:
value
-
the value to add to this decimal.
Returns:
the new decimal with the value subtraced.
subtractPercent
Subtracts a percentage value from the current value of the
decimal. For example a value of 10 represent 10% or a value of
85 represents 85%.
Parameters:
value
-
the value to subtract.
Returns:
a new decimal with the subtracted percentage value.
subtractPercent
Subtracts a percentage value from the current value of the
decimal. For example a value of 10 represent 10% or a value of
85 represents 85%.
Parameters:
value
-
the value to subtract.
Returns:
a new decimal with the subtracted percentage value.
toString
Returns a string representation of this object.
Returns:
a string representation of this object.
valueOf
The valueOf() method is called by the ECMAScript interpret to return
the "natural" value of an object. The Decimal object returns its
current value as number. With this behavior script snippets can
be written like:
var d = new Decimal( 10.0 );
var x = 1.0 + d.add( 2.0 );
where x will be at the end 13.0.
Returns:
the value of this object.