Andoza:Rounddown: Versiyalar orasidagi farq

Kontent oʻchirildi Kontent qoʻshildi
Uzgen (munozara | hissa)
Tahrir izohi yoʻq
 
Uzgen (munozara | hissa)
Tahrir izohi yoʻq
Qator 1:
<includeonly>{{#expr:{{#ifexpr: ({{{1}}}) >= (({{{1}}}) round {{{2|0}}}) |({{{1}}}) round {{{2|0}}}|(({{{1}}}) round {{{2|0}}}) - 1/{{pow|10|{{{2|0}}}}}}}}}</includeonly><noinclude>
 
{{tim|rounddown}}
 
This template rounds a numeric expression down to a given number of decimal places. ''Down'' in the sense that e.g. -2.5 is rounded to -3. Compare {{tim|roundtozero}}.
 
; Usage&#58;
: {{Tlx|{{PAGENAME}}|''expression''}}
: {{Tlx|{{PAGENAME}}|''expression''|''decimals''}}
: Both parameters can be any valid numeric expression.
: The ''decimals'' parameter defaults to 0 and is rounded to the nearest integer.
: ''decimals'' can be negative to round down to a multiple of a power of ten.
; Examples&#58;
: {{Tlx|{{PAGENAME}}|3.14159|3}} = {{{{PAGENAME}}|3.14159|3}}
: {{Tlx|{{PAGENAME}}|-3.14159|3}} = {{{{PAGENAME}}|-3.14159|3}}
: {{Tlx|{{PAGENAME}}|314159|-3}} = {{{{PAGENAME}}|314159|-3}}
: {{Tlx|{{PAGENAME}}|-314159|-3}} = {{{{PAGENAME}}|-314159|-3}}
: {{Tlx|{{PAGENAME}}|+1/3}} = {{{{PAGENAME}}|+1/3}}
: {{Tlx|{{PAGENAME}}|2&lt;1}} = {{{{PAGENAME}}|2<1}}
: {{Tlx|{{PAGENAME}}|-1/3}} = {{{{PAGENAME}}|-1/3}}
: {{Tlx|{{PAGENAME}}|-2/3}} = {{{{PAGENAME}}|-2/3}}
;For expressions containing '''equal signs''' use <tt>1=</tt>''expression'' - the second example fails&#58;
: {{Tlx|{{PAGENAME}}|<nowiki>1=3&lt;=4</nowiki>}} = {{{{PAGENAME}}|1=3<=4}}
: {{Tlx|{{PAGENAME}}|<nowiki>3&lt;=4</nowiki>}} = {{{{PAGENAME}}|3<=4}}
 
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
[[Category:Mathematical templates|{{PAGENAME}}]]
</noinclude>