Difference between revisions of "Template:BlockVolume"

From Space Engineers Wiki
Jump to: navigation, search
m (More whitespace cleanup)
m (Usage info of volumeonly. Handle non-yes values as no.)
Line 1: Line 1:
<includeonly>{{#vardefine:blockwidth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lwidth | small = swidth}}}}}} {{#vardefine:blockheight| {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lheight | small = sheight}}}}}} {{#vardefine:blockdepth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = ldepth | small = sdepth}}}}}} {{#vardefine:blockvolume | {{#expr: {{#var:blockwidth}} * {{#var:blockheight}} * {{#var:blockdepth}} * {{#switch:{{{2}}} | large = 15.625 | small = 0.125}}}}}} {{#if:{{{volumeonly|}}} | {{#var:blockvolume}} | {{#var:blockwidth}}&times;{{#var:blockheight}}&times;{{#var:blockdepth}} ({{#var:blockvolume}}&nbsp;m<sup>3</sup>)}}</includeonly><noinclude>
+
<includeonly>{{#vardefine:blockwidth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lwidth | small = swidth}}}}}} {{#vardefine:blockheight| {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = lheight | small = sheight}}}}}} {{#vardefine:blockdepth | {{#show: {{{1|}}}|? {{#switch: {{{2}}}| large = ldepth | small = sdepth}}}}}} {{#vardefine:blockvolume | {{#expr: {{#var:blockwidth}} * {{#var:blockheight}} * {{#var:blockdepth}} * {{#switch:{{{2}}} | large = 15.625 | small = 0.125}}}}}} {{#switch:{{{volumeonly}}} | yes = {{#var:blockvolume}} | #default = {{#var:blockwidth}}&times;{{#var:blockheight}}&times;{{#var:blockdepth}} ({{#var:blockvolume}}&nbsp;m<sup>3</sup>)}}</includeonly><noinclude>
  
 
Displays block dimensions and calculates its volume.
 
Displays block dimensions and calculates its volume.
  
Usage:<pre>{{BlockVolume|Block name|size}}</pre>
+
Usage:<pre>{{BlockVolume|Block name|size|[volumeonly=[yes]]}}</pre>
 
Where ''Block name'' is the page of the block and ''size'' is ''small'' or ''large'' for respective the block size.
 
Where ''Block name'' is the page of the block and ''size'' is ''small'' or ''large'' for respective the block size.
 
<pre>{{BlockVolume|Large Thruster|small}}</pre>
 
<pre>{{BlockVolume|Large Thruster|small}}</pre>

Revision as of 17:05, 27 March 2020


Displays block dimensions and calculates its volume.

Usage:
{{BlockVolume|Block name|size|[volumeonly=[yes]]}}

Where Block name is the page of the block and size is small or large for respective the block size.

{{BlockVolume|Large Thruster|small}}

Gives ×× (Expression error: Unexpected * operator. m3)

{{BlockVolume|Large Thruster|large}}

Gives ×× (Expression error: Unexpected * operator. m3)

{{BlockVolume|Large Thruster|large|volumeonly=yes}}

Gives Expression error: Unexpected * operator.