• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:To USD round

  • Template
  • Talk
  • Language
  • Watch
  • Edit
Template documentationviewedithistorypurge
Shortcuts
  • {{USDrTemplate:USDr}}
  • {{To USD rTemplate:To USD r}}
  • {{ToUSDrTemplate:ToUSDr}}

This template converts a value given in the national currency of a given country to a round US dollar figure. The intended use is for large round figures, when you don't want €3.2 million turning into US$3,784,640, you just want a round figure like US$3,600,000. It tries to mimic the same number of significant figures as are present in the original amount. The template uses values published by the IMF.[1]

Contents

  • 1 Usage
  • 2 Parameters
  • 3 Examples
  • 4 See also
  • 5 Data subtemplates
  • 6 References
  • 7 TemplateData

Usage

edit

{{To USD round|AMOUNT|COUNTRY|YEAR|sf=SIGFIG}}

Parameters

edit

There are three unnamed parameters, and one named parameter:

  • |1= is the amount in local currency to be converted to US dollars. Required.
  • |2= is the country name or 3-letter ISO code of the country whose currency is being converted. Required.
  • |3= is the year to use for the US dollar exchange rate against the currency of the other country. Possible values: see § Data subtemplates below. Optional; default = 2019.
  • |sf= is number of significant figures. The converted value is displayed to that precision. Optional; the default is the number of significant figures in the amount given in param 1.

Examples

edit
  • {{To USD round|5200|Mexico}} displays 270. That is, 5200 Mexican pesos would exchange to roughly 270 US dollars (to two significant digits) at the 2019 exchange rate.
  • {{To USD round|5200|MEX}} → 270
  • {{To USD round|1250|FRA}} → 1,400
  • {{To USD round|5200|MEX}} → 270
  • {{Formatnum:{{To USD round|185000|RUS}}}} ⟶ 28,600.
  • {{To USD round|5200|MEX|year=1998}} displays Undefined year "1998" since data for 1998 has not been defined. It will add the page to Category:Pages using an undefined year in Template:To USD round
  • {{To USD round|5200|MEX|year=2009}} displays 380 since data for 2009 has not been entered for Mexico. It will add the page to Category:Pages using an undefined country code in Template:To USD round

  • {{To USD round|586000|BRA|year=2011}} → 350,000
  • {{To USD round|586000|BRA|year=2019}} → 149,000
  • {{To USD round|586000|BRA|year=}} → 149,000
  • {{To USD round|586000|BRA}} → 149,000
  • {{To USD round|620000000|BRA|year=2015}} → 190,000,000
  • {{To USD round|620000000|BRA|year=2015|sf=4}} → 186,400,000
  • {{To USD round|640|MEX|sf=5}} → 33.220 # Some combos make no sense; USD doesn't have tenths of a cent.

See also

edit
  • Template:US$
  • Template:Inflation: Calculates a value in a given country in a given year based on an amount of currency in the same country in another year.
  • Template:To USD
  • Template:Round
  • Template:significant figures
  • Template:International dollars: Converts a value in a given country in a given year to international dollars.
  • Template:Per capita
  • {{formatnum:}}

Data subtemplates

edit
  • 1960
  • 1961
  • 1962
  • 1963
  • 1964
  • 1965
  • 1966
  • 1967
  • 1968
  • 1969
  • 1970
  • 1971
  • 1972
  • 1973
  • 1974
  • 1975
  • 1976
  • 1977
  • 1978
  • 1979
  • 1980
  • 1981
  • 1982
  • 1983
  • 1984
  • 1985
  • 1986
  • 1987
  • 1988
  • 1989
  • 1990
  • 1991
  • 1992
  • 1993
  • 1994
  • 1995
  • 1996
  • 1997
  • 1998
  • 1999
  • 2000
  • 2001
  • 2002
  • 2003
  • 2004
  • 2005
  • 2006
  • 2007
  • 2008
  • 2009
  • 2010
  • 2011
  • 2012
  • 2013
  • 2014
  • 2015
  • 2016
  • 2017
  • 2018
  • 2019
  • 2020
  • 2021
  • 2022
  • 2023
  • 2024
  • 2025

References

edit
  1. ↑ "Official exchange rate (LCU per US$, period average)". Retrieved 14 April 2013.

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:To USD round in articles based on its TemplateData.

TemplateData for To USD round

Template to convert other currencies into United States dollars, by year, based on information from the International Monetary Fund, and with selected number of significant figures

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
amount1

value in foreign currency to convert to USD

Example
175000
Numberrequired
country code2 country

ISO 3166-1 alpha-3 country code

Example
MEX
Linerequired
yearyear

Year to convert currency. Values: 1960–2022.

Default
2019
Example
2002
Numberoptional
significant figuressf

If numeric, rounds to that many significant figures. If omitted, rounds to number of significant figures in 'amount'.

Example
3
Numberoptional
The above documentation is transcluded from Template:To USD round/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:To_USD_round&oldid=1346105440"