ROUND()

Description

The ROUND() function rounds a number to a specified number of decimal places.
The function returns the nearest number of the specified order. In case when given number has equal distance to surrounding numbers, the function uses banker’s rounding for float number types and rounds away from zero for the other number types (Decimal).

Syntax

  1. > ROUND(number, decimals)
  2. > ROUND(number)

Arguments

ArgumentsDescription
numberRequired. The number to round, including any numeric data type supported now.
decimalsOptional. An integer that represents the number of decimal places you want to round to. Default value is 0.
decimals>0 then the function rounds the value to the right of the decimal point.
decimals<0 then the function rounds the value to the left of the decimal point.
decimals=0 then the function rounds the value to integer.

Examples

  1. round(1.5) ----> 2
  2. round(2.5) ----> 2
  3. round(3.5) ----> 4
  4. round(12, -1) ----> 10
  5. round(12) ----> 12
  6. round(-12, -1) ----> -20
  7. round(-12, 1) ----> -12
  8. round(12.345) ----> 12
  9. round(12.345, 1) ----> 12.3
  10. round(-12.345, 1) ----> -12.3
  11. round(-12.345, -1) ----> -10
  12. round(-12.345) ----> -12

Constraints

Currently, MatrixOne doesn’t support select function() without from tables.