### DESCRIPTION

The round() function in Ninox is used to adjust numeric values to the nearest integer value or to a specified number of digits appearing to the right of the decimal point (.).

### SYNTAX

1. round(‘Numeric Field’)
2. round(1234.5678)
3. round(‘Numeric Field’,#)
4. round(1234.5678,#)

WHERE

• round is the function keyword. This must be entered into the Ninox function editor in all lower-case characters
• ‘Numeric Field’ is a reference to a numeric field in a Ninox table
• 1234.5678 is a hard-coded numeric value with any number of digits both to the left and to the right of the decimal point
• # is an optional parameter used to indicate the exact number of digits to appear to the right of the decimal point in the resultant value

### EXAMPLE

• round(1234.5678) = 1235
• round(1234.5678,1) = 1234.6
• round(1234.5678,2) = 1234.57
• round(1234.5678,3) = 1234.568

### USAGE

• There are many instances where a number that includes a fractional value rounded past the hundredths position (two digits to the right of the decimal point), must be rounded up or down in order to truncate excess digits. For example, when currencies are converted across international boundaries, it is common for the resultant value to be rendered with as many as four digits to the right of the decimal point. However, most nations only recognize measures of currency to the hundredth position (two characters to the right of the decimal point). In a situation such as this, the round() function is used to ensure that the result of the translation of one national currency to another is rendered with only two digits to the right of the decimal point but, at the same time, the rounded value is correctly calculated based on whether or not the third character to the right of the decimal point is less than 5 (round down), or equal to or greater than 5 (round up).

Revision: 5