Numeric functions

Use numeric functions to return numeric values in a formula.

Table 1: Numeric functions

Function

Syntax

Description

Ceil(num)

num: A number

Returns the smallest integer that is greater than or equal to a specified number.

For example:
Ceil(14.2)
returns 15

Floor(num)

num: A number

Returns the largest integer that is not greater than a specified number.

For example:
Floor(14.8)
returns 14

Log(num)

num: A number

Returns the natural logarithm of a specified number.

For example:
Log(100)
returns 4.605

Log10(num)

num: A number

Returns the base 10 logarithm of a specified number.

For example:
Log10(100)
returns 2

Mod(num, divisor)

  • num: A number
  • divisor: The divisor

Returns the remainder of the division of a number by another number.

For example:
Mod(15,2)
returns 1

Power(num, exponent)

  • num: A number
  • exponent: The exponent

Raises a number to a power.

The operator ^ (caret) can be used instead of this function.

For example:
Power(2,3)
returns 8

Round(num, digits)

  • num: A number
  • digits: The number of decimal places to round off to

Returns a numeric value, rounded to a specified number of decimal places.

For example:
Round(14.81, 1)
returns 14.8

Sign(num)

num: A number

Returns -1 if a specified number is negative, 0 if the specified number is zero, or +1 if the specified number is positive.

For example:
Sign(-2)
returns -1

ToText(num, digits)

  • num: A number
  • digits: Number of decimal places to use. This parameter is optional, and its default value is 0.

Converts a specified number to a string. The number is truncated to the specified number of decimal places.

For example:
ToText(12.1451, 2)
returns 12.14

Truncate(num, digits)

  • num: A number
  • digits: Number of decimal places to truncate

Returns a numeric value, truncated at a specified number of decimal places.

For example:
Truncate(12.281, 1)
returns 12.200
Table 2: Example of the ToText(num, digits) function: ToText({Temperature},2)
Temperature Text
-2.01 -2.0
-1.06 -1.1
0.08 0.1
1.07 1.1
2.08 2.1
3.99 4.0
5.00 5.0
This formula returns 12.14: ToText(12.1451, 2).
Table 3: Example of the Truncate(num, digits) function: Truncate({Temperature},1)
Temperature Truncated
-2.01 -2.00
-1.06 -1.00
0.08 0.00
1.07 1.00
2.08 2.00
3.99 3.90
5.00 5.00
This formula returns 12.200: Truncate(12.281, 1).