round(
round(
NUMBER
,
STEP
)

The round( function rounds a number to a specified increment.

Parameters

This function has two parameters:

number – is the number you want to round.

step – is the increment you want to round to. For example if the increment is 1, the value will be rounded to an integer. If the increment is 12, the value will be rounded to the nearest dozen.

Description

This function rounds a number to a specified increment. This example rounds the quantity to the nearest dozen.

    round(Quantity,12)

The output of this formula will be 0, 12, 24, 36, etc. The formula above may round the number down, for example 14 will round down to 12. Here is another formula that will always round up to the next higher dozen (i.e. 13 will round up to 24):

    round(Quantity+6,12)

Non-integer increments are Ok. This next formula rounds the temperature to the nearest 1/2 degree.

    round(Temperature,0.5)

Since dates are really numbers, the formula below rounds the StartDate to the nearest Monday. (The numbers for Mondays are multiples of 7.)

    round(StartDate,7)

Note: This function uses the half-even rounding method, which is different from the Round half to even rounding method used by Numeric Patterns.

See Also

- - -- subtracts the numeric value on the right from the numeric value on the left.
- * -- multiplies the numeric value on the left by the numeric value on the right.
- / -- divides one numeric value by another.
- \ -- performs integer division.
- ^ -- raises a number to a power.
- + -- works differently depending on the type of operands used with it. If both operands are numeric, it does numerical addition. If either operand is text the + operator concatenates (joins together) the two operands.
- abs( -- calculates the absolute value of a number.
- ceil( -- converts a number to an integer, truncating toward positive infinity.
- divzero( -- divides two numbers, returns zero if denominator is zero.
- divzeroerror( -- divides two numbers, returns an error if the denominator is zero.
- fix( -- converts a number to an integer, truncating toward zero.
- fixed -- converts a floating point number to fixed point.
- float( -- converts a fixed point number to a floating point number.
- infinity( -- returns infinity.
- int( -- converts a number to an integer, truncating toward negative infinity.
- mod -- computes the remainder (modulo) after integer division.
- nan( -- checks to see if a numeric value is invalid.
- nanerror( -- converts invalid numeric values into an error.
- nanzero( -- converts invalid numeric values into zero.
- randominteger( -- generates a random integer between the starting and ending values.
- rnd( -- generates a random number between 0 and 1.
- validnumber( -- checks to see if a numeric value is valid.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0