User:Erin Umbreon/Sandbox/Convert coordinate
Jump to navigation
Jump to search
Description
Formats a sequence of (X, Y, Z) coordinates to pretty-formatted text.
For backwards compatibility, coordinates can be passed either as individual parameters, or separated by commas in a single parameter. The single-parameter form is discouraged, as it can cause bugs when handling number formats that use commas for decimal separators (this can occur when the coordinate values come from a Semantic MediaWiki query).
{{convert coordinate|<x>|<y>|<z>}}
{{convert coordinate|<x>, <y>, <z>}}Parameters
- x
- The X coordinate. Required. Decimals are allowed.
- y
- The Y coordinate. Required. Decimals are allowed.
- z
- The Z coordinate. Optional. Decimals are allowed.
Example
{{convert coordinate|9.22|8}}
(X:9.22, Y:8)
{{convert coordinate|12|8.54|5}}
(X:12, Y:8.54, Z:5)
{{convert coordinate|12, 8.54, 5}}(X:12, Y:8.54, Z:5)
Examples of what happens when numbers with commas as decimal separators are passed in each form:
{{convert coordinate|12|8,54|5}}
(X:12, Y:8,54, Z:5)
{{convert coordinate|12, 8,54, 5}}(X:12, Y:8, Z:54) (this is incorrect output)