Template:Octal
- العربية
- الدارجة
- অসমীয়া
- تۆرکجه
- Basa Bali
- বাংলা
- کوردی
- Cymraeg
- Español
- Euskara
- فارسی
- Føroyskt
- Galego
- Hausa
- हिन्दी
- Հայերեն
- Bahasa Indonesia
- Italiano
- ಕನ್ನಡ
- 한국어
- Latviešu
- Македонски
- ꯃꯤꯇꯩ ꯂꯣꯟ
- Bahasa Melayu
- Sesotho sa Leboa
- ਪੰਜਾਬੀ
- Português
- Română
- संस्कृतम्
- Scots
- Simple English
- Slovenščina
- Shqip
- தமிழ்
- తెలుగు
- ไทย
- Українська
- اردو
- Tiếng Việt
- ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
- 中文
08
The {{Octal }} template makes it easy to convert decimal numbers (base 10) into octal (base 8) and formats them according to a variety of common notations.
Usage
This template has one mandatory parameter: the decimal number that is to be converted to octal (represented below as n). It may be supplied as the first unnamed/positional parameter ({{Octal |n}}), or as the value of the named value ({{Octal |value=n}}) or 1 ({{Octal |1=n}}) parameters.
Basic examples
Formatting
This template also provides an optional second parameter which controls the formatting of the conversion output, with several §Notation keywords that correspond to various alternate notations for octal numbers other than the default subscripted Arabic numeral 8 (n8). The keywords may be defined as an unnamed/positional second parameter ({{Octal |n|formatting_keyword}}) or as the value of the named affix ({{Octal |n|affix=formatting_keyword}}) or 2 ({{Octal |n|2=formatting_keyword}}) parameters.
Both of the suffix notations, i.e. the default formatting and the oct keyword, provide the added benefit of displaying a tooltip that reads "octal number (base 8)" to further assist in identifying non-decimal numbers within dense prose content.
Notation keywords
- Default formatting (parameter empty or undefined/absent keyword): Subscripted serif 8 suffix (8)
{{Octal |4632}}→ 110308
oct: Subscripted serif oct suffix (oct){{Octal |4632|oct}}→ 11030oct
o: Lowercase o prefix (o){{Octal |4632|o}}→ o11030
0o: Arabic numeral 0 with lowercase o prefix (0o){{Octal |4632|0o}}→ 0o11030
\/backslash/bs/revsol/rs: Reverse solidus (backslash) prefix (\){{Octal |4632|\}}→ 11030円
digit/no/none: Unformatted output{{Octal |4632|none}}→ 11030
TemplateData
TemplateData for Octal
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Decimal number | value1 | The number input to convert from decimal (base 10) to octal (base 8) | Number | required |
| Notation | affix2 | Select from a variety of common notations for octal values in lieu of the default subscripted 8
| Line | optional |
Format: inline
See also
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.