Skip to main content
Version: 7.9

round

This function is used by Ignition's Expression language.

Description

Rounds a floating point number. If the decimals argument is omitted, then the number is rounded to the nearest integer value, and the result will be a long (64-bit integer). If a number of decimal places are specified, the result will be a double (64-bit floating point value), and the result will be rounded to the given number of decimal places.

Syntax

round(number[, decimals])

  • Parameters

    • float number - The number to round.

    • int decimals - Optional. The number of decimal places to round to. Defaults to 0.

  • Results

    • int/float - The value provided rounded to the specified decimal places.

Examples

Code Snippet
round(3.829839, 2) //returns 3.83