Template:Cents/doc: Difference between revisions
ArrowHead294 (talk | contribs) |
ArrowHead294 (talk | contribs) mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{dochead}} | {{dochead}}{{substitute|always}} | ||
This template calculates the cent value of its first argument (defaults to 1). An optional second argument controls the precision, it defaults to 0 decimal places. | This template calculates the cent value of its first argument (defaults to 1). An optional second argument controls the precision, it defaults to 0 decimal places. | ||
=== Usage === | === Usage === | ||
Use this template like this | Use this template like this | ||
<pre>{{subst: cents|ratio| | <pre>{{subst: cents|ratio|prec}}</pre> | ||
=== Example === | === Example === | ||
Line 23: | Line 21: | ||
: 23.46001 | : 23.46001 | ||
Add in a lowercase C to the end of the expression to add {{tlx|c}}: | |||
<pre>{{subst: cents|5/4c|2}}</pre> | |||
gives: | |||
: 386.31{{c}} | |||
Add in an uppercase C to add {{tlx|cent}}: | |||
<pre>{{subst: cents|5/4C|2}}</pre> | |||
gives: | |||
: 386.31{{cent}} | |||
=== See also === | === See also === | ||
* [[Template:Cent]], [[Template:C]] – templates to insert the cent symbol, with and without (respectively) a link to [[cent|the article about cents]]. | * [[Template:Cent]], [[Template:C]] – templates to insert the cent symbol, with and without (respectively) a link to [[cent|the article about cents]]. |