You are viewing the MafiaScum.net Wiki. To play the game, visit the forum.

Template:Percentage: Difference between revisions

From MafiaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>{{{1}}}/{{{2}}} ({{#expr: (({{{1}}} / {{{2}}})*100)round3}}%)</includeonly><noinclude>
<includeonly>{{{1}}}/{{{2}}} ({{#expr: (({{{1}}} / {{{2}}})*100)round{{{3|1}}}}}%)</includeonly><noinclude>
== Summary ==
== Summary ==
This template generates fractions and their percentage, rounded.
This template generates fractions and their percentage, rounded.


== Syntax ==
== Syntax ==
<pre>{{percentage|{{{1}}}|{{{2}}}}}</pre>
<pre>{{percentage|{{{1}}}|{{{2}}}|{3}}}}}</pre>


== Parameters ==
== Parameters ==
Line 11: Line 11:
=== {{{2}}} ===
=== {{{2}}} ===
:the denominator of the fraction; must not be zero
:the denominator of the fraction; must not be zero
=== {{{3}}} ===
:the decimal number to be rounded to; defaults to 1


== Example ==
== Example ==
{{percentage|2|3}}
{{percentage|2|3|4}}


[[Category:Templates|{{PAGENAME}}]]</noinclude>
[[Category:Templates|{{PAGENAME}}]]</noinclude>

Revision as of 17:49, 6 April 2012

Summary

This template generates fractions and their percentage, rounded.

Syntax

{{percentage|{{{1}}}|{{{2}}}|{3}}}}}

Parameters

{{{1}}}

the numerator of the fraction

{{{2}}}

the denominator of the fraction; must not be zero

{{{3}}}

the decimal number to be rounded to; defaults to 1

Example

2/3 (66.6667%)