User:Willscrlt/Rndnear/doc

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Test cases[edit | edit source]

Buggy rndnear:

  • [{{Rndnear|4.5678}}] → [4.50]
  • [{{Rndnear|2.3456}}] → [2.25]
  • [{{rndnear|1.2345}}] → [1.25]
  • [{{rndnear|{{{empty|}}}}}] → []
  • [{{rndnear|Text|10}}] → []

Modified rndnear that returns a blank (like {{isnumeric}}) instead of an error

  • [{{User:Willscrlt/Rndnear|4.5678}}] → [4.50]
  • [{{User:Willscrlt/Rndnear|2.3456}}] → [2.25]
  • [{{User:Willscrlt/Rndnear|1.2345}}] → [1.25]
  • [{{User:Willscrlt/Rndnear|{{{empty|}}}}}] → []
  • [{{User:Willscrlt/Rndnear|Text|10}}] → []

See also[edit | edit source]

Original documentation follows:

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
  • {{rndnear|Text|10}}

See also[edit | edit source]


</includeonly>