Ḍâri Wikipèḍia bhâsa Madhurâ, lombhung pangataowan mardhika
Ini adalah halaman dokumentasi untuk Modul:BaseConvert
TemplateStyles' src
attribute must not be empty.
Converts numbers to a specified base between 2 and 36, for use in templates such as {{ Binary }} , {{ Octal }} , {{ Hexadecimal }} , etc.
local BaseConvert = require ( 'Module:BaseConvert' )
BaseConvert . convert ({ n = 14600926 , base = 16 }) -- returns 'DECADE'
Arguments:
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.
In wikimarkup, this module may be called with a function name n tom
, e.g.:
Markup
Renders as
{{#invoke:BaseConvert|16to10| FF }}
{{#invoke:BaseConvert|10to36|500}}
{{#invoke:BaseConvert|10to16|Foo|default=0}}
All options above are supported, excluding |base=
, |from=
and |n=
which are set by the mandatory options.
Markup
Renders as
{{#invoke:BaseConvert|10to10|500}}
{{#invoke:BaseConvert|10to10|FooBar}}
{{#invoke:BaseConvert|10to10|FooBar|default=}}
{{#invoke:BaseConvert|10to16|Foo}}
Math templates
Functions
Numeral systems
Functions
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]] (value formatting)
[[Template:{{{2}}}|{{{2}}} ]]
Numeral systems
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
Conversions
[[Template:{{{2}}}|{{{2}}} ]] many units (see: list ) [[Template:{{{2}}}|{{{2}}} ]] abbreviated {{ convert }} [[Template:{{{2}}}|{{{2}}} ]] {{ convert }} for infoboxes [[Template:{{{2}}}|{{{2}}} ]] barrels of oil to tonnes [[Template:{{{2}}}|{{{2}}} ]] long hundredweights, quarters and pounds to kilograms; long tons and hundredweights to pounds and metric tons [[Template:{{{2}}}|{{{2}}} ]] miles and chains to kilometres linking "chains"
[[Template:{{{2}}}|{{{2}}} ]] degrees, minutes, and seconds to decimal degrees deg2dms decimal degrees to degrees, minutes, and seconds deg2hms decimal degrees to hour angle (in hours, minutes, and seconds) hms2deg hour angle (in hours, minutes, and seconds) to decimal degrees [[Template:{{{2}}}|{{{2}}} ]] calculate inflation of Consumer Price Index-related prices [[Template:{{{2}}}|{{{2}}} ]] population density in an area [[Template:{{{2}}}|{{{2}}} ]] railway track gauges
[[Template:{{{2}}}|{{{2}}} ]] bigger font to match TeX \displaystyle (standalone formulas only)
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]] bra–ket notation [[Template:{{{2}}}|{{{2}}} ]], [[Template:{{{2}}}|{{{2}}} ]] calculations :mw:Help:#expr ; formatting indicators ⌈3.14⌉ , Cèṭa'an:Floor (no calculation performed) [[Template:{{{2}}}|{{{2}}} ]] slant fractions 3 ⁄5 (not for maths/science articles; use standing or upright fractions {{sfrac }}
instead) [[Template:{{{2}}}|{{{2}}} ]] integral symbols
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
angbr angular brackets
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]] multiline delimiters (2–5 lines inclusive) [[Template:{{{2}}}|{{{2}}} ]] absolute values (paired vertical lines) [[Template:{{{2}}}|{{{2}}} ]] short text-based formulas [[Template:{{{2}}}|{{{2}}} ]] [mathematical] calligraphic font; alternative to LaTeX \mathcal{...}
[[Template:{{{2}}}|{{{2}}} ]] individual italicized maths variables in normal text
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]] a line set above/below a sequence of characters [[Template:{{{2}}}|{{{2}}} ]] an arc set above a sequence of characters
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]] arbitrary characters/diacritics set above/below one another [[Template:{{{2}}}|{{{2}}} ]] parentheses that can be resized Cèṭa'an:Pars [[Template:{{{2}}}|{{{2}}} ]] "standing" or upright fractions 3 / 5 (use in maths/science articles instead of{{fraction }}
)
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]] subscripts and superscripts [[Template:{{{2}}}|{{{2}}} ]] Wrap TeX in <math> tags [[Template:{{{2}}}|{{{2}}} ]] symbol indicating the end of a proof [[Template:{{{2}}}|{{{2}}} ]] measurement values, uncertainties and units [[Template:{{{2}}}|{{{2}}} ]] various overarrows, underarrows, etc.
Boxes
Tags
Notices
Boxes Tags
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]