$round: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 09:38, 5 September 2005

Returns the floating number you specify rounded to the specified number of decimals.

$round(N,D)
  • N is the number you want to round.
  • D is the number of decimals you want. If no D is supplied it will assume 0.

Examples

The following will echo pi with 3 decimals:

/echo -a Pi: $round($pi,3)

See also

$int, $floor and $ceil.