Difference between revisions of "Template:Inflation"

From Emulation General Wiki
Jump to navigation Jump to search
(Created page with "<includeonly><abbr title="${{#iferror:{{#ifexpr:(({{{3}}} >= {{#switch:{{{1}}}|USD=1959}}) and ({{{3}}} <= {{{4|{{CURRENTYEAR}}}}}) and ({{{4|{{CURRENTYEAR}}}}} <= {{CURRENTYE...")
 
m
(3 intermediate revisions by 2 users not shown)
Line 59: Line 59:
 
{{#ifexpr:((2015 >= {{{3}}}) and (2015 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0126158320570537 }}
 
{{#ifexpr:((2015 >= {{{3}}}) and (2015 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0126158320570537 }}
 
{{#ifexpr:((2016 >= {{{3}}}) and (2016 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0213011000365963 }}
 
{{#ifexpr:((2016 >= {{{3}}}) and (2016 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0213011000365963 }}
{{#ifexpr:((2017 >= {{{3}}}) and (2017 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0244 }}
+
{{#ifexpr:((2017 >= {{{3}}}) and (2017 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0244258329692818 }}
{{#ifexpr:((2018 >= {{{3}}}) and (2018 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0186 }}
+
{{#ifexpr:((2018 >= {{{3}}}) and (2018 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0181221007526015 }}
 +
{{#ifexpr:((2019 >= {{{3}}}) and (2019 < {{{4|{{CURRENTYEAR}}}}}))|* 1.0123358439630637 }}
 +
{{#ifexpr:((2020 >= {{{3}}}) and (2020 < {{{4|{{CURRENTYEAR}}}}}))|* 1.03 }}
 
}} <!-- End inflation tables -->
 
}} <!-- End inflation tables -->
 
) round {{{r|0}}}}}|[[NaN]]}}|[[NaN]]}} in {{CURRENTYEAR}} money">${{{2}}}</abbr></includeonly><noinclude>
 
) round {{{r|0}}}}}|[[NaN]]}}|[[NaN]]}} in {{CURRENTYEAR}} money">${{{2}}}</abbr></includeonly><noinclude>
Only USD is supported. Only 1959 and later is supported. Output rounded to the nearest dollar.
+
Displays a product's price as well as a server-side computation of an inflation-adjusted version in United States Dollars. The data is taken from [https://data.worldbank.org/indicator/fp.cpi.totl.zg the World Bank], and can only go as far back as 1959. The output is rounded to the nearest dollar.
  
 
Use: <code><nowiki>{{Inflation|Currency|Value|Year}}</nowiki></code>
 
Use: <code><nowiki>{{Inflation|Currency|Value|Year}}</nowiki></code>
Line 69: Line 71:
 
Example: $199 in 1991 <code><nowiki>{{Inflation|USD|199|1991}}</nowiki></code> = {{Inflation|USD|199|1991}}
 
Example: $199 in 1991 <code><nowiki>{{Inflation|USD|199|1991}}</nowiki></code> = {{Inflation|USD|199|1991}}
  
[https://data.worldbank.org/indicator/fp.cpi.totl.zg Inflation source]
+
[[Category:General wiki templates]]
 
</noinclude>
 
</noinclude>

Revision as of 05:28, 5 July 2021

Displays a product's price as well as a server-side computation of an inflation-adjusted version in United States Dollars. The data is taken from the World Bank, and can only go as far back as 1959. The output is rounded to the nearest dollar.

Use: {{Inflation|Currency|Value|Year}}

Example: $199 in 1991 {{Inflation|USD|199|1991}} = $199