Template:Money/toDec

From Wikinews, the free news source you can write!
Jump to: navigation, search
[edit] Template-info.svg Template documentation

Usage[edit]

This template takes a currency code and turns it into an interger specifying the number of places to round to (currencies that do not use base 10 [MRO and MGA] round to 1 place)

If it can't match a currency name, it returns 2 as a sane default. It converts all curency symbols to uppercase. It returns 2 decimal places for things that don't have inheirent rounding (like gold [XAU] and silver [XAG]) or that it doesn't know. Some examples:

  • {{Money/toDec|USD}} → 2
  • {{Money/toDec|CNY}} → 1
  • {{Money/toDec|AMD}} → 0
  • {{Money/toDec|non-existant currency}} → 2

All information taken from table on Wikipedia article ISO 4217 on 00:47, 20 September 2009 (UTC).

See also[edit]