Template:Gold efficiency calculation

{{#vardefine:tgv|{{{tgv|{{{2}}}}}}{{#vardefine:tb|{{#expr:{{#var:tgv}}-{{#var:buy}}}}{{tt|{{fd|{{#expr:({{#var:tgv}} / {{#var:buy}} * 100) round 1}}%}}
 * {{#ifexpr:{{#var:tb}} < 0|{{#var:tb}}g|+{{#var:tb}}g}}}} {{doc}}