cpr.foundation.DecimalType

Decimal data type.

Index

Methods
Name Return Type Description
getDecimalType DecimalType Returns numberValue as DecimalType.
compareTo Number Compare values.
dividedBy DecimalType Perform a division (÷) operation.
minus DecimalType Perform a subtraction (-) operation.
plus DecimalType Perform a plus (+) operation.
remainder DecimalType Perform the remaining (%) operation.
times DecimalType Perform a multiplication (x) operation.
toNumber Number Returns the current decimal value as a number.

Constructor

DecimalType(data)
Create a decimal object using number.
Parameters
name type description
data Number The number to make a decimal.

Methods

getDecimalType(numberValue)
Returns numberValue as DecimalType.
Parameters
name type description
numberValue Number
return DecimalType
getDecimalType(stringValue)
Returns stringValue as DecimalType.
Parameters
name type description
stringValue String
return DecimalType
compareTo(x)
Compare values.
Parameters
name type description
x DecimalType Value to compare.
return Number Comparison result.
(1: The current value is larger. / 0: The current value and the param value are the same / -1: The current value is smaller. / NaN: Invalid param was entered.)
dividedBy(x)
Perform a division (÷) operation.
Parameters
name type description
x DecimalType Data to divide.
return DecimalType Result of calculation.
minus(x)
Perform a subtraction (-) operation.
Parameters
name type description
x DecimalType Data to be subtracted.
return DecimalType Result of calculation.
plus(x)
Perform a plus (+) operation.
Parameters
name type description
x DecimalType Data to add.
return DecimalType Result of calculation.
remainder(x)
Perform the remaining (%) operation.
Parameters
name type description
x DecimalType Data to do the rest of the calculation.
return DecimalType Result of calculation.
times(x)
Perform a multiplication (x) operation.
Parameters
name type description
x DecimalType Data to multiply.
return DecimalType Result of calculation.
toNumber()
Returns the current decimal value as a number.
return Number Number data of the current decimal value.