Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 06:18, 18 February 2025 by Prd (talk | contribs) (Created page with "{{documentation subpage}} {{Lua|Module:String}} <templatedata>{ "description": "Outputs the ratio character (U+2236) between two optional arguments or instead of any colon character in a single argument.", "params": { "1": { "label": "width", "description": "width or larger of both dimensions", "type": "number", "required": false }, "2": { "label": "height", "description": "height or smaller of both dimensions", "type": "number", "re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Outputs the ratio character (U+2236) between two optional arguments or instead of any colon character in a single argument.

Template parameters

ParameterDescriptionTypeStatus
width1

width or larger of both dimensions

Numberoptional
height2

height or smaller of both dimensions

Numberoptional

Example Usage

Source Output Comment
{{ratio}}
4{{ratio}}3
4∶3
{{ratio|4|3}}
4∶3
{{ratio|4|3|2}}
4∶3 only two parameters are supported
{{ratio|4}}
4∶1 "∶1" is automatically added when only 1 argument with no colon is given
{{ratio|4:3}}
4∶3 Single argument with colon is replaced with ratio symbol.
{{ratio|4:4:4}}
4∶4∶4 Works with multiple colons

See also