FANDOM


Information icon-grey
This is a documentation subpage for Template:Round.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Round invokes 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


Community content is available under CC-BY-SA unless otherwise noted.