ROUNDUP

The ROUNDUP function rounds a real number to a maximum number of decimal places away from zero.

Syntax

ROUNDUP(
    number,
    num_digits
)

Parameters
  • number: Real number to round.
  • num_digits: Number of decimal digits to round number to.
Returned value

The ROUNDUP function returns a real number.

Additional Information

If num_digits is a number greater than zero, number is rounded away from zero to the number of decimal places indicated by num_digits. If it is zero, therefore, the result will be the integer closest to number moving away from zero. Finally, if num_digits is a digit less than zero, number is rounded to the left of the decimal point (see an example below).

When viewing the result of this function, it is important to ensure that the format of the field or measure (configurable in the Column tools or Measure tools tab) is not modifying its appearance on the canvas.

Examples

This example rounds a positive and a negative number to a variable number of digits:

ROUNDUP function. Example of use

The behavior of the different rounding functions is summarized below:

  • ROUNDDOWN: Rounds a number towards zero and the number of decimal places can be specified.
  • ROUNDUP: Rounds a number away from zero and the number of decimal places can be specified.
  • ROUND: Rounds a number towards the nearest rounding value and the number of decimal places can be specified.
  • INT: Rounds a number to the nearest equal or lower integer.
  • TRUNC: Rounds a number towards its integer part and the number of decimal places can be specified.

Examples:

Rounding functions

Related functions
Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 12:24