Template:Round

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to navigation Jump to search
Template documentation
This documentation is transcluded from Template:Round/doc. [edit] [history] [purge]
Template:Round invokes function main in Module:Round using Lua.

Rounds a number, adding trailing 0s for cleaner table sorting if necessary.

Usage

{{Round|value|rounding}}

The first parameter is the number, the second parameter (alternatively the round parameter) are the number of decimal places to round to. Trailing 0s are added up to the number of digits specified.

A negative number simply floors - to round to an integer place, use #expr with the round function.

Commas are supported in the value, but not in the rounding.

Examples
  • {{Round|111.111|1}} = 111.1
  • {{Round|555.555|1}} = 555.6
  • {{Round|111.111|5}} = 111.11100
  • {{#expr:111.111 round -2}} = 100