decimal()

Description:

Convert a string or 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.

Parameters:

stringExp

A specified numeric string, which may contain a decimal point.

numberExp

The numeric value which is less than or equal to 64 bits.

Return value:

Big decimal number

Example:

decimal("123456789012345678901234567890")

123456789012345678901234567890

decimal(1234567890123456)

1234567890123456 (BigDecimal type)

Related functions:

float()

int()

long()

number()

string()