Difference between revisions of "Template:Rndnear/doc"

From Ava Zinn Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
m (Protected Template:Rnd/c6dec1 [edit=sysop:move=sysop])
m (16 revisions from wikipedia:Template:Rndnear/doc)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{#expr:{{{1}}}/10^5}}0000{{rnd/-|0|{{{2}}}}}</includeonly><noinclude>This subtemplate divides {{{1}}} by 100,000, then adds zeros back on, then adds zeros after the point using {{tl|rnd/-}}.
+
{{Documentation subpage}}
 +
This template rounds to a multiple.  It takes two parameters.
 +
#the number to be rounded (any real number)
 +
#the multiple to be rounded to
  
[[Category:Subtemplates of Template Rnd]]</noinclude>
+
*{{xpsoc|rndnear|0.1234|0.05}}
 +
*{{xpsoc|rndnear|12.65|0.25}}
 +
*{{xpsoc|rndnear|-9.123|1}}
 +
*{{xpsoc|rndnear|-912|5}}
 +
*{{xpsoc|rndnear|39123|10}}
 +
 
 +
==See also==
 +
*{{tl|rnd}}
 +
*{{tl|rndfrac}}
 +
 
 +
<includeonly>[[Category:Mathematical function templates]]</includeonly>

Latest revision as of 08:45, 15 March 2016

This template rounds to a multiple. It takes two parameters.

  1. the number to be rounded (any real number)
  2. the multiple to be rounded to
  • {{rndnear|0.1234|0.05}} → 0.10
  • {{rndnear|12.65|0.25}} → 12.75
  • {{rndnear|-9.123|1}} → −9
  • {{rndnear|-912|5}} → −910
  • {{rndnear|39123|10}} → 39,120

See also[edit]