This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.
Converts numbers to a specified base between 2 and 36, for use in templates such as {{Binary}}, {{Octal}}, {{Hexadecimal}}, etc.
n - (required) the number to be converted, as a string. It may be a number instead, if the input base is 10.
base - (required) the base to which the number should be converted. May be between 2 and 36, inclusive.
from - the base of the input. Defaults to 10 (or 16 if the input has a leading '0x'). Note that bases other than 10 are not supported if the input has a fractional part.
precision - number of digits to be rendered after the radix point. Trailing zeros will be added if needed. If not specified, however many digits are needed will be shown, up to 10.
width - minimum number of digits to be rendered before the radix point. Leading zeros will be added if needed.
default - Value to return if n is empty or non-numeric. Defaults to the value of n.
prefix / suffix - wikitext to add before/after the returned result. Will not be added if n is empty or non-numeric. For example, you might use a prefix of 0x when converting to hex, or a suffix of <sub>8</sub> when converting to octal.
This page is a redirect. The following categories are used to track and monitor this redirect:
To a help page: This is a redirect from any page inside or outside of help namespace to a page in that namespace.
The above category link leads to a list of redirects from inside help namespace. For redirects from outside help space, see Category:Redirects to help namespace.
TemplateStyles' src attribute must not be empty.
The above template is being used incorrectly. Please remove it from this redirect.
When appropriate, protection levels are automatically sensed, described and categorized.
All options above are supported, excluding |base=, |from= and |n= which are set by the mandatory options.
This page is a redirect. The following categories are used to track and monitor this redirect:
To a help page: This is a redirect from any page inside or outside of help namespace to a page in that namespace.
The above category link leads to a list of redirects from inside help namespace. For redirects from outside help space, see Category:Redirects to help namespace.
TemplateStyles' src attribute must not be empty.
The above template is being used incorrectly. Please remove it from this redirect.
When appropriate, protection levels are automatically sensed, described and categorized.