Template:Decimals

From Darkan
Revision as of 19:29, 19 June 2012 by imported>Joeytje50 (Protected "Template:Decimals": used on the mainpage ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[view] [edit] [purge] Template documentation

This documentation is transcluded from Template:Decimals/doc.

The Decimals template is used to format a number, up to 5 decimals.

Usage

{{decimals|number|decimals}}

Note: The maximum number for decimals is limited to 5, but this value can be increased if required.

Examples

  • {{decimals|1234|-2}} yields 1200
  • {{decimals|1234|0}} yields 1234
  • {{decimals|1234|1}} yields 1234.0
  • {{decimals|1234|2}} yields 1234.00
  • {{decimals|9/8|5}} yields 1.12500
  • {{decimals|1/3|5}} yields 0.33333 (only the first 5 digits are returned)
  • {{decimals|22/7|5}} yields 3.14286 (only the first 5 digits are returned)
  • {{decimals|1/33|5}} yields 0.03030
  • {{decimals|0.006|1}} yields 0.0