decimal function

Casts the value expr to DECIMAL.

Syntax

decimal(expr)

Arguments

  • expr: An expression that can be cast to DECIMAL.

Returns

The result is DECIMAL(10, 0).

This function is a synonym for CAST(expr AS decimal(10, 0))

See cast function for details on casting.

Examples

> SELECT decimal('5.2');
 5