Omnistudio Mathematical Functions

Functions that operate on numbers.

Omnistudio ABS Function

Returns the absolute value of a numeric expression.

Signature

ABS(expression)

Return Value

Number

Parameters

Parameter

Data Type

Necessity

Description

expression

Number

Required

An expression that resolves to the number for which the absolute value is to be returned.

Positive Expression Example
Positive Expression Example

Formula: ABS(4)

Return value: 4

Negative Expression Example
Negative Expression Example

Formula: ABS(-4.50)

Return value: 4.5

Negative Expression Example
Negative Expression Example

Formula: ABS(2 - (2 * 3))

Return value: 4

Omnistudio ROUND function

Rounds a numeric expression up or down to a specified level of precision.

Signature

ROUND(expression, precision, direction)

Return Value

Number

Parameters

Parameter

Data Type

Necessity

Description

expression

Number

Required

An expression that resolves to the number to be rounded.

precision

Integer

Optional

A non-negative integer that indicates the number of decimal places to which to round the result. Specify 0 to return an integer. Specify a positive integer to round to that number of decimal places. Do not specify a negative number or a decimal value.

If the number has fewer decimal places than the specified precision, the function returns only the lower number of decimal places. Specify a precision of 0 to return an integer. By default, the function rounds the result to two decimal places of precision.

direction

Constant

Optional

A constant that indicates the direction in which to round the result:

  • CEILING rounds the least significant digit of the result up.

  • DOWN rounds the least significant digit of the result down. The digit remains unchanged regardless of the digit to its right.

  • FLOOR rounds the least significant digit of the result down.

  • HALF_DOWN rounds the least significant digit of the result down if the digit to its right is less than or equal to 5.

  • HALF_EVEN rounds the least significant digit of the result up or down to the nearest even digit if the digital to its right is equal to 5.

  • HALF_UP rounds the least significant digit of the result up if the digit to its right is greater than or equal to 5.

  • UP rounds the least significant digit of the result up. The digit increases by one regardless of the digit to its right.

By default, the function rounds up or down based on the digit to the right of the least significant digit of the result (to the right of the specified level of precision). If you specify a direction, you must also specify a precision.

Round with No Precision and No Direction Example
Round with No Precision and No Direction Example

Formula: ROUND(4.115)

Return value: 4.12

Round with Precision 0 and No Direction Example
Round with Precision 0 and No Direction Example

Formula: ROUND(4.115, 0)

Return value: 4

Round with Precision 2 and Direction DOWN Example
Round with Precision 2 and Direction DOWN Example

Formula: ROUND(2.119, 2, DOWN)

Return value: 2.11

Round with Precision 2 and Direction UP Example
Round with Precision 2 and Direction UP Example

Formula: ROUND(2.111, 2, UP)

Return value: 2.12

Round with Precision 1 and Direction FLOOR Example
Round with Precision 1 and Direction FLOOR Example

Formula: ROUND(2.55, 1, FLOOR)

Return value: 2.5

Round with Precision 1 and Direction CEILING Example
Round with Precision 1 and Direction CEILING Example

Formula: ROUND(2.55, 1, CEILING)

Return value: 2.6

Round with Precision 0 and Direction FLOOR Example
Round with Precision 0 and Direction FLOOR Example

Formula: ROUND(2.5, 0, FLOOR)

Return value: 2

Round with Precision 0 and Direction CEILING Example
Round with Precision 0 and Direction CEILING Example

Formula: ROUND(2.5, 0, CEILING)

Return value: 3

Round with Precision 2 and Direction HALF_DOWN Example
Round with Precision 2 and Direction HALF_DOWN Example

Formula: ROUND(2.575, 2, HALF_DOWN)

Return value: 2.57

Round with Precision 2 and Direction HALF_UP Example
Round with Precision 2 and Direction HALF_UP Example

Formula: ROUND(2.575, 2, HALF_UP)

Return value: 2.58

Round with Precision 2 and Direction HALF_EVEN Example
Round with Precision 2 and Direction HALF_EVEN Example

Formula: ROUND(2.225, 2, HALF_EVEN)

Return value: 2.22

Omnistudio SQRT Function

Returns the square root of a numeric expression.

Signature

SQRT(expression)

Return Value

Number

Parameters

Parameter

Data Type

Necessity

Description

expression

Number

Required

An expression that resolves to the non-negative number for which the square root is to be returned.

Positive Integer Example
Positive Integer Example

Formula: SQRT(3 * 12)

Return value: 6

Positive Decimal Number Example
Positive Decimal Number Example

Formula: SQRT(2.5)

Return value: 1.5811388300841898

Negative Integer Example
Negative Integer Example

Formula: SQRT(-4)

Return value: {}