Difference between revisions of "Template:Infobox/Part/FuelConsumption/Cell"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (-formatnum/core usage;)
m (Add ability to use custom caption)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{Infobox/Part/Line|{{Infobox/Part/Dict|Consumption}}|2=<abbr title="{{#formatnum:{{#expr: {{{2}}}*{{{1}}}/1000}}|{{{5|2}}}|{{DS}}|t}}&nbsp;kg/s">{{Formatnum|{{{2}}}|{{{5|2}}}}}</abbr>&nbsp;{{Unit|{{{4|l}}}}}/s|3={{#if: {{{3|}}}|<abbr title="{{#formatnum:{{#expr: {{{3}}}*{{{1}}}/1000}}|{{{5|2}}}|{{DS}}|t}}&nbsp;kg/s">{{Formatnum|{{{3}}}|{{{5|2}}}}}</abbr>&nbsp;{{Unit|{{{4|l}}}}}/s}}}}</includeonly><noinclude>Creates one fuel consumption entry for {{Tl|Infobox/Part}}. Has at least two parameters with the first for the density in kg/m<sup>3</sup> ({{{1}}}) and the second for the fuel consumption in L/s at atmospheric pressure ({{{2}}}) (or if no difference exists for all situations) and could be use {{{3}}} for the fuel consumption in L/s in vacuum.
+
<noinclude>{{Infobox/Part/preview|
 +
</noinclude>{{Infobox/Line|{{#if: {{{5|}}}|{{{5}}}|{{Infobox/Part/Dict|Consumption}}}}|<abbr title{{=}}"{{#formatnum:{{#expr: {{{2<noinclude>|9.15</noinclude>}}}*{{{1<noinclude>|5000</noinclude>}}}/1000}}|{{{4|2}}}|{{DS}}|t}}&nbsp;{{Dict|k}}{{Dict|g}}/{{Dict|s}}">{{Formatnum|{{{2<noinclude>|9.15</noinclude>}}}|{{{4|2}}}}}</abbr>&nbsp;{{Unit|{{{3|{{Dict|l}}}}}}}/{{Dict|s}}}}<noinclude>
 +
}}
  
The {{{4}}} parameter changes the unit (per default l) which will be parsed through {{Tl|Unit}}. The precision can be determined with {{{5}}} and defaults to 2 decimal places.
+
Creates one fuel consumption entry for {{Tl|Infobox/Part}}.
  
[[Category:Templates]]</noinclude>
+
{{Parameter table|name=number|parameters=
 +
{{Parameter row|1|Density in kg/m<sup>3</sup>}}
 +
{{Parameter row|2|Consumption in l/s}}
 +
{{Parameter row|3|Visible unit for the consumption in X/s. Will be parsed through {{Tl|Unit}}.|<tt>l</tt>}}
 +
{{Parameter row|4|Number of decimal places shown.|<tt>2</tt>}}
 +
{{Parameter row|5|Caption shown by the cell.|Not set (automatically translated <tt>Fuel consumption</tt> by {{Tl|Infobox/Part/Dict}})}}
 +
}}
 +
 
 +
[[Category:Calculating templates]]
 +
[[Category:Infobox/Part metatemplates]]</noinclude>

Latest revision as of 16:19, 11 September 2024

Fuel consumption 9.15 l/s

Creates one fuel consumption entry for {{Infobox/Part}}.

# Optional Description Default
1 No Density in kg/m3
2 No Consumption in l/s
3 Yes Visible unit for the consumption in X/s. Will be parsed through {{Unit}}. l
4 Yes Number of decimal places shown. 2
5 Yes Caption shown by the cell. Not set (automatically translated Fuel consumption by {{Infobox/Part/Dict}})