NexJ Logo

Round()

Rounds a number to the specified number of decimal points. Digits that are rounded off are rounded up if they have a value of five or greater, and down if they have a value less than five. This function takes two integer arguments, or one number argument and one integer argument, and returns a number value.

Syntax

Round(<number_to_round>, <number_of_decimals>)

Input

number_to_round

integer, number, null

The number to round.

number_of_decimals

integer

The number of decimal places to round the result to.

Output

number

Examples

  • The expression Round(3.1415, 0) returns 3.0.
  • The expression Round(3.1415, 1) returns 3.1.
  • The expression Round(3.1415, 3) returns 3.142.