Template:Infobox Recipe: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1:
{{#vardefine:mat1cost|{{formatnum:{{#ask:[[{{{mat1}}}]]|?Cost=|mainlabel=-}}|R}}}}
{{#vardefine:mat2cost|{{formatnum:{{#ask:[[{{{mat2}}}]]|?Cost=|mainlabel=-}}|R}}}}
{{#vardefine:output1cost|{{formatnum:{{#ask:[[{{{output1}}}]]|?Cost=|mainlabel=-}}|R}}}}
{| class="wikitable"
! colspan="4" | Requirements
Line 21 ⟶ 24:
{{!}} [[{{{mat1}}}]]
{{!}} style="text-align: right;" {{!}} {{{mat1qty|1}}}
{{!}} style="text-align: right;" {{!}} {{formatnum:{{#vardefineecho:mat1total|{{#expr:{{{mat1qty|1}}} * {{formatnum#if:{{#askvar:[[{{{mat1mat1cost}}}]]|?Cost=|mainlabel=-{{#var:mat1cost}}|R0}}}}}}}}
{{!}}-
}}
Line 28 ⟶ 31:
{{!}} [[{{{mat2}}}]]
{{!}} style="text-align: right;" {{!}} {{{mat2qty|1}}}
{{!}} style="text-align: right;" {{!}} {{formatnum:{{#vardefineecho:mat1totalmat2total|{{#expr:{{{mat2qty|1}}} * {{formatnum#if:{{#askvar:[[{{{mat2mat2cost}}}]]|?Cost=|mainlabel=-{{#var:mat2cost}}|R0}}}}}}}}
{{!}}-
}}
Line 41 ⟶ 44:
{{!}} [[{{{output1}}}]]
| style="text-align: right;" {{!}} {{{output1qty|1}}}
| style="text-align: right;" {{!}} {{formatnum:{{#vardefineecho:output1output1costtotal|{{#expr:{{{output1qty|1}}} * {{formatnum#if:{{#askvar:[[{{{output1output1cost}}}]]|?Cost=|mainlabel=-{{#var:output1cost}}|R0}}}}}}}}
|-
! colspan="3" | Profit
| style="text-align: right;" {{!}} {{formatnum:{{#expr:{{#var:output1output1costtotal}} - {{#var:mat1total}}}}}}
|}