# toDecimal

Converts a value to a decimal.

## Arguments

1. Input element.
2. Optional: Scale of the decimal as a string or numeric data type.
3. Optional: Rounding mode for the decimal. It can be the name of the mode as a string or the corresponding integer constant:
   * "UP" or 0
   * "DOWN" or 1
   * "CEILING" or 2
   * "FLOOR" or 3
   * "HALF\_UP" or 4
   * "HALF\_DOWN" or 5
   * "HALF\_EVEN" or 6
   * "UNNECESSARY" or 7

   The default value is "FLOOR". For more information about rounding modes, see the [Oracle documentation](https://docs.oracle.com/javase/7/docs/api/java/math/RoundingMode.html).

## Examples

| Expression | Result |
| --- | --- |
| toDecimal(531.256986, 2, "DOWN") | 531.25 |