Template:Base/doc: Difference between revisions

From Nguhcraft Wiki
Jump to navigation Jump to search
Astaryuu (talk | contribs)
No edit summary
Astaryuu (talk | contribs)
No edit summary
Line 3: Line 3:
===Usage===
===Usage===
<pre><nowiki>
<pre><nowiki>
{{Base|number|radix|precision|numerals=str|format=separator}}
{{Base|number|radix|precision|numerals=str|format=true|separator=sep|point=pt}}
</nowiki></pre>
</nowiki></pre>
* '''number''': The number in decimal.
* '''number''': The number in decimal.
Line 9: Line 9:
* '''precision''': The number of digits after the decimal point. Optional; if not included, it defaults to 0.
* '''precision''': The number of digits after the decimal point. Optional; if not included, it defaults to 0.
* '''numerals''': A series of numerals to use. <code>str</code> is the string of numerals in order from 0. Optional; if not included, it defaults to "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".
* '''numerals''': A series of numerals to use. <code>str</code> is the string of numerals in order from 0. Optional; if not included, it defaults to "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".
* '''format''': If separators are included in the output. If it is present, the separator is equal to <code>separator</code>. If format is not present, then the separator is ",". To disable separators, set format to an empty string.
* '''format''': If separators are included in the output. If it is present and equal to false, there are no separators. If it is not present, there are separators.
* '''separator''': The separator to be used when formatted. Equal to <code>sep</code>. If separator is not present, then the separator is ",". To be sure the space appears when using a space separator, use the HTML code &#32;.
* '''point''': The mark used between the integral and fractional component. Equal to <code>pt</code>. If point is not present, then the mark is ".".

Revision as of 19:07, 5 July 2026

This template formats a decimal number into a number in a given base.

Usage

{{Base|number|radix|precision|numerals=str|format=true|separator=sep|point=pt}}
  • number: The number in decimal.
  • radix: The base to convert to.
  • precision: The number of digits after the decimal point. Optional; if not included, it defaults to 0.
  • numerals: A series of numerals to use. str is the string of numerals in order from 0. Optional; if not included, it defaults to "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".
  • format: If separators are included in the output. If it is present and equal to false, there are no separators. If it is not present, there are separators.
  • separator: The separator to be used when formatted. Equal to sep. If separator is not present, then the separator is ",". To be sure the space appears when using a space separator, use the HTML code .
  • point: The mark used between the integral and fractional component. Equal to pt. If point is not present, then the mark is ".".