Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a2605b8309652a7e

Jump to content

Template:Octal/doc

From Wikipedia, the free encyclopedia

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

[edit]

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

[edit]
  • {{Octal|4632}} → 110308
  • {{Octal|value=81681.125}} → 237421.18
  • {{Octal|1=-51985}} → -1454218

Formatting

[edit]

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

[edit]
  • 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

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Octal in articles based on its TemplateData.

TemplateData for Octal

Convert decimal numbers to octal (base 8) and format them for presentation as such
Decimal numbervalue
1
The number input to convert from decimal (base 10) to octal (base 8)
Notationaffix
2
Select from a variety of common notations for octal values in lieu of the default subscripted 8
Suggested values
  • backslash
  • bs
  • revsol
  • rs
  • \
  • o
  • 0o
  • no
  • none
  • digit
  • oct

See also

[edit]