[dismiss]
Difference between revisions of "Template:Convert coordinate"
Jump to navigation
Jump to search
(creation) |
m |
||
Line 1: | Line 1: | ||
{{#if: {{{1|}}} |<!-- | {{#if: {{{1|}}} |<!-- | ||
-->{{#vardefine:x-coord|{{#explode:{{{1|}}}|,|0}}}}{{#vardefine:y-coord|{{#explode:{{{1|}}}|,|1}}}}{{#vardefine:z-coord|{{#explode:{{{1|}}}|,|2}}}}('''<small>X:</small>''' {{#var:x-coord}}, '''<small>Y:</small>''' {{#var:y-coord}}{{#if: {{#var:z-coord}}|, '''<small>Z:</small>''' {{#var:z-coord}}}})}}<noinclude> | -->{{#vardefine:x-coord|{{#explode:{{{1|}}}|,|0}}}}{{#vardefine:y-coord|{{#explode:{{{1|}}}|,|1}}}}{{#vardefine:z-coord|{{#explode:{{{1|}}}|,|2}}}}('''<small>X:</small>'''{{#var:x-coord}}, '''<small>Y:</small>'''{{#var:y-coord}}{{#if: {{#var:z-coord}}|, '''<small>Z:</small>'''{{#var:z-coord}}}})}}<noinclude> | ||
== Description == | == Description == | ||
Formats a sequence of (X, Y, Z) coordinates to pretty-formatted text. | Formats a sequence of (X, Y, Z) coordinates to pretty-formatted text. | ||
Line 10: | Line 10: | ||
== Example == | == Example == | ||
<pre>{{Convert coordinate|9.22, 8}}</pre> | |||
{{Convert coordinate|9.22, 8}} | |||
<pre>{{Convert coordinate|12, 8.54, 5}}</pre> | <pre>{{Convert coordinate|12, 8.54, 5}}</pre> | ||
{{Convert coordinate|12, 8.54, 5}} | {{Convert coordinate|12, 8.54, 5}} | ||
[[Category:Formatting templates]]</noinclude> | [[Category:Formatting templates]]</noinclude> |
Revision as of 20:12, 20 June 2017
Description
Formats a sequence of (X, Y, Z) coordinates to pretty-formatted text.
{{Convert coordinate|<x>, <y>, <z>}}
Parameters
- coordinates
- The coordinates. Requires at least two comma-separated coordinates. Third coordinate (z) is 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)