decimal()

Description:

Convert a string or a numeric value to a big decimal number.

Syntax:

decimal(stringExp)

decimal(numberExp)

Note:

The parameter stringExp is a string consisting of a number (and sometimes a decimal point).

 

The parameter numberExp is a numeric value which is less than or equal to 64 bits. For values more than 64 bits, you will have to use the stringExp to represent them.

Parameter:

stringExp

A specified numeric string

numberExp

A numeric value

Return value:

Big decimal number

Example:

decimal("123456789012345678901234567890")

123456789012345678901234567890

decimal(1234567890123456)

1234567890123456 (BigDecimal type)

Related function:

float()

int()

long()

number()

string()