Template:Cents/doc: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) |
ArrowHead294 (talk | contribs) mNo edit summary |
||
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 === |
Revision as of 17:58, 19 May 2025
![]() |
This template should always be substituted (i.e. use {{subst:Cents}} ).
|
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
Use this template like this
{{subst: cents|ratio|precision}}
Example
This input in the wiki source
{{subst: cents|3/2|5}}
produces the following output
- 701.95500
Intervals can even be typed as evaluable mathematical expressions. For example:
{{subst: cents|3^12/2^19|5}}
gives:
- 23.46001
See also
- Template:Cent, Template:C – templates to insert the cent symbol, with and without (respectively) a link to the article about cents.