Template:Distance: Difference between revisions
Jump to navigation
Jump to search
(Cleanup.) |
HiddenDragon (talk | contribs) (Added template demo and documentation templates) |
||
Line 8: | Line 8: | ||
| {{#expr: {{{ft|0}}} * 3 / 10 }} m / {{{ft|0}}} ft {{color|red|(ERROR: Distance not in metric!)}} {{Main namespace only|[[Category:Articles with incorrect usage of the Distance template]][[Category:Articles with errors]]}} | | {{#expr: {{{ft|0}}} * 3 / 10 }} m / {{{ft|0}}} ft {{color|red|(ERROR: Distance not in metric!)}} {{Main namespace only|[[Category:Articles with incorrect usage of the Distance template]][[Category:Articles with errors]]}} | ||
}} | }} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude>{{Documentation|content= | ||
A template for displaying distances: | |||
== Examples == | |||
{{Template demo | |||
| style = table | |||
| <nowiki>{{Distance|melee}}</nowiki> | |||
| <nowiki>{{Distance|reach}}</nowiki> | |||
| <nowiki>{{Distance|ranged}}</nowiki> | |||
| <nowiki>{{Distance|short ranged}}</nowiki> | |||
| <nowiki>{{Distance|m=1.5}}</nowiki> | |||
| <nowiki>{{Distance|ft=50}}</nowiki> | |||
}} | |||
Game files use metric, and apply the calculation mentioned in [[Template:M to ft]] when the options are set to imperial. This is why the template expects a value in metric and refuses to apply the reverse transform, which may lead to unexpected results due to rounding. | Game files use metric, and apply the calculation mentioned in [[Template:M to ft]] when the options are set to imperial. This is why the template expects a value in metric and refuses to apply the reverse transform, which may lead to unexpected results due to rounding. | ||
}} | |||
[[Category:Templates]] | |||
</noinclude> | </noinclude> |
Latest revision as of 11:27, 19 January 2025
Template documentation
A template for displaying distances:
Examples
Markup | Renders as |
---|---|
{{Distance|melee}} | ![]() |
{{Distance|reach}} | ![]() |
{{Distance|ranged}} | ![]() |
{{Distance|short ranged}} | ![]() |
{{Distance|m=1.5}} | ![]() |
{{Distance|ft=50}} | ![]() |
Game files use metric, and apply the calculation mentioned in Template:M to ft when the options are set to imperial. This is why the template expects a value in metric and refuses to apply the reverse transform, which may lead to unexpected results due to rounding.