Difference between revisions of "Template:Round"

From Isleward Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#expr:{{{1}}}round{{{2}}}}}{{Round/trailing|{{{1}}}|{{{2}}}}}<!--
+
<includeonly>{{#expr:{{{1}}}round{{{2}}}}}<!--
</includeonly><noinclude>
+
-->{{#ifexpr: {{{2}}}>0  and {{{1}}}={{{1}}}round0 |.0}}<!--
 +
-->{{#ifexpr: {{{2}}}>1  and {{{1}}}={{{1}}}round1  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>2  and {{{1}}}={{{1}}}round2  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>3  and {{{1}}}={{{1}}}round3  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>4  and {{{1}}}={{{1}}}round4  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>5  and {{{1}}}={{{1}}}round5  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>6  and {{{1}}}={{{1}}}round6  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>7  and {{{1}}}={{{1}}}round7  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>8  and {{{1}}}={{{1}}}round8  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>9  and {{{1}}}={{{1}}}round9  |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>10 and {{{1}}}={{{1}}}round10 |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>11 and {{{1}}}={{{1}}}round11 |0}}<!--
 +
-->{{#ifexpr: {{{2}}}>12 and {{{1}}}={{{1}}}round12 |0}}<!--
 +
--></includeonly><noinclude>
 
== Description ==
 
== Description ==
 
Rounds parameter 1 to parameter 2 decimal places.
 
Rounds parameter 1 to parameter 2 decimal places.
Line 11: Line 24:
 
== Examples ==
 
== Examples ==
 
* <code><nowiki>{{round|1.2345|2}}</nowiki></code> is {{round|1.2345|2}}
 
* <code><nowiki>{{round|1.2345|2}}</nowiki></code> is {{round|1.2345|2}}
*{{#expr:1.2345round2}}
 
*{{Round/trailing|1.2345|2}}
 
 
</noinclude>
 
</noinclude>

Latest revision as of 00:51, 31 May 2022

Description[edit]

Rounds parameter 1 to parameter 2 decimal places.

Usage[edit]

{{round|1.2345|2}}

Examples[edit]

  • {{round|1.2345|2}} is 1.23