Template:Cents: Difference between revisions

Xenwolf (talk | contribs)
default ratio 1, default precision 0
Xenwolf (talk | contribs)
interims solution
Line 1: Line 1:
{{#number_format:{{#expr: 1200*ln({{{1|{{{ratio|1}}}}}})/ln(2)}}|{{{2|{{{precision|0}}}}}}|.|}}<noinclude>
<!-- {{#number_format:{{#expr: 1200*ln({{{1|{{{ratio|1}}}}}})/ln(2)}}|{{{2|{{{precision|0}}}}}}|.|}}<noinclude>
This template calculates the cent value of its argument (defaults to 1). An optional second parameter controls the precision, it defaults to 0 decimal places.
This template calculates the cent value of its argument (defaults to 1). An optional second parameter controls the precision, it defaults to 0 decimal places.


<big>It requires the MediaWiki [https://www.mediawiki.org/wiki/Extension:NumberFormat Extension:NumberFormat] being [[Special:Version|installed]].</big>
<big>It requires the MediaWiki [https://www.mediawiki.org/wiki/Extension:NumberFormat Extension:NumberFormat] being [[Special:Version|installed]].</big>
[[Category:Templates]]
</noinclude>
-->{{#expr: 1200*ln({{{1|{{{ratio|1}}}}}})/ln(2) round {{{precision|{{{2|0}}}}}}}}<noinclude>
This template calculates the cent value of its argument (defaults to 1). An optional second parameter controls the precision, it defaults to 0 decimal places.
<big>'''This is a temporary solution.'''</big>
It doesn't care for dangling zeros.


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>