Tell Me
 

Number Functions

Previous previous|next Next Page

You use number functions to accept numeric input. The number functions return numeric values.

The three most commonly used number functions are the following:

  • ROUND: Rounds a column, an expression, or a value to n decimal places
  • MOD: Returns the remainder of x divided by y
  • TRUNC: Truncates a column, an expression, or a value to n decimal places
FunctionDescriptionExample
ROUND(n,[ m]) ROUND returns n rounded to m places right of the decimal point. If m is omitted, n is rounded to 0 places. SELECT ROUND(15.193,1) "Round" FROM DUAL;;
MOD(m/n) MOD returns remainder of m divided by n. Returns m if n is 0. SELECT MOD(11,4) "Modulus" FROM DUAL;
TRUNC(m, n) TRUNC returns n truncated to m decimal places. If m is omitted, n is truncated to 0 places. SELECT TRUNC(15.79,1) "Truncate" FROM DUAL;

Write SQL query to determine salaries rounded to the nearest thousandth. Then write query to compare those values to the values of salaries truncated to the thousandth position