Template:Weight: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "<includeonly>frameless|middle|link=|x25px Weight: {{{kg}}} kg / {{{lb}}} lb</includeonly><noinclude> Usage: {{code|<nowiki>{{Weight|kg=0.9|lb=1.8}}</nowiki>}} Result: {{Weight|kg=0.9|lb=1.8}} </noinclude>")
 
(Added documentation/template demo templates)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly>[[File:Weight Icon.jpg|frameless|middle|link=|x25px]] Weight: {{{kg}}} kg / {{{lb}}} lb</includeonly><noinclude>
<includeonly>{{SmallIcon|Weight Icon.png|class=bg3wiki-lightmode-drop-shadow}}&nbsp;Weight{{#if: {{{kg|}}} {{{lb|}}}
Usage: {{code|<nowiki>{{Weight|kg=0.9|lb=1.8}}</nowiki>}}
| {{#if: {{{kg|}}}
  <!-- #8239 is non-breaking thin space. And yes, the kg to lb factor in BG3 is exactly 1/2. -->
  |<nowiki>:</nowiki> {{{kg}}}&#8239;kg / {{#expr:{{{kg|}}}*2}}&#8239;lb
  |<nowiki>:</nowiki> {{#expr:{{{lb}}}/2}}&#8239;kg / {{{lb}}}&#8239;lb
  }}
}}</includeonly><noinclude>{{Documentation|content=
Displays a weight with an icon depending on the input weight.


Result: {{Weight|kg=0.9|lb=1.8}}
== Examples ==
{{Template demo
| style = table
| <nowiki>{{Weight|kg=0.9}}</nowiki>
| <nowiki>{{Weight|lb=1.8}}</nowiki>
| <nowiki>{{Weight}}</nowiki>
}}
 
}}
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 23:23, 19 January 2025

Template documentation

Displays a weight with an icon depending on the input weight.

Examples

Markup Renders as
{{Weight|kg=0.9}}
 Weight: 0.9 kg / 1.8 lb
{{Weight|lb=1.8}}
 Weight: 0.9 kg / 1.8 lb
{{Weight}}
 Weight