$Round

From m204wiki
Revision as of 14:26, 29 July 2014 by Mlarocca (talk | contribs) (Mlarocca moved page $ROUND to $Round: Lower case change)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function rounds a number to a specified number of decimal places.

Syntax

The format of the $ROUND function is:

$ROUND(number, places)

where:

  • number is the number to be rounded.
  • places is the number of significant decimal places to which the number should be rounded.

$ROUND returns the first argument, rounded to the number of decimal places specified in the second argument. If the second argument is negative, $ROUND returns the first argument unaltered and prints an error message. Omitted arguments are set to zero.

Example

$ROUND(200.565, 2) equals 200.57 $ROUND(200.565, 0) equals 201 $ROUND(200.565) equals 201 $ROUND(-200.565, 1) equals -200.6 $ROUND(-200.565, 2) equals -200.57