Difference between revisions of "Template:Inflation/testcases"
imported>Hawkeye7 |
imported>Jonesey95 (add sanity check cases) |
||
| Line 1: | Line 1: | ||
| + | ==Examples for all supported currency types== | ||
| + | ===100 in 2000, adjusted to latest supported year=== | ||
| + | {{testcase table|_showcode=yes|AU|100|2000}} | ||
| + | {{testcase table|_showcode=yes|AU-road|100|2000}} | ||
| + | {{testcase table|_showcode=yes|BD|100|2000}} | ||
| + | {{testcase table|_showcode=yes|CA|100|2000}} | ||
| + | {{testcase table|_showcode=yes|DE|100|2000}} | ||
| + | {{testcase table|_showcode=yes|IR|100|1379}} | ||
| + | {{testcase table|_showcode=yes|JP|100|2000}} | ||
| + | {{testcase table|_showcode=yes|KRW|100|2000}} | ||
| + | {{testcase table|_showcode=yes|PH|100|2000}} | ||
| + | {{testcase table|_showcode=yes|PK|100|2000}} | ||
| + | {{testcase table|_showcode=yes|UK|100|2000}} | ||
| + | {{testcase table|_showcode=yes|UK-GDP|100|2000}} | ||
| + | {{testcase table|_showcode=yes|US|100|2000}} | ||
| + | {{testcase table|_showcode=yes|US-GDP|100|2000}} | ||
| + | {{testcase table|_showcode=yes|ZAR|100|2000}} | ||
| + | |||
| + | ===100 in 2000, adjusted to 2014=== | ||
| + | {{testcase table|_showcode=yes|AU|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|AU-road|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|BD|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|CA|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|DE|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|IR|100|1379|1393}} | ||
| + | {{testcase table|_showcode=yes|JP|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|KRW|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|PH|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|PK|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|UK|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|UK-GDP|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|US|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|US-GDP|100|2000|2014}} | ||
| + | {{testcase table|_showcode=yes|ZAR|100|2000|2014}} | ||
| + | |||
| + | |||
==Changes to data set== | ==Changes to data set== | ||
; dependencies | ; dependencies | ||
Latest revision as of 18:49, 7 January 2021
Contents
Examples for all supported currency types
100 in 2000, adjusted to latest supported year
Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table
100 in 2000, adjusted to 2014
Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table Template:Testcase table
Changes to data set
- dependencies
- Test cases for
| UK | TEST |
|---|---|
| A widget in 1900 was worth £90 (Approximately £9810 today) | A widget in 1900 was worth £90 (Approximately £8245 today) |
| A widget in 1900 was worth £90 (Approximately £2271 in 1980) | A widget in 1900 was worth £90 (Approximately £2271 in 1980) |
| A pre-decimal penny was worth in 1854 about the same as 39p today. | A pre-decimal penny was worth in 1854 about the same as 33p today.[1] |
| This should be 1.031252968557 | £1 in 2011 is worth approximately £1.03 today. |
Errors
| Missing parameters fail |
|---|
{{Inflation}}
{{Inflation}} Error when using {{Inflation}}: Error when using {{Inflation}}: |
| Index fail |
|---|
{{Inflation|a|b|c}}
{{Inflation}} Error when using {{Inflation}}: Error when using {{Inflation}}: |
| Non-numeric fail |
|---|
{{Inflation|DE|b|c}}
{{Inflation}} Error when using {{Inflation}}: NaN, check parameters for non-numeric data: Error when using {{Inflation}}: NaN, check parameters for non-numeric data: |
Significant digits
{{Inflation|US|1|2017|2018|r=1}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 1 | Template:Round |
{{Inflation|US|1|2017|2018|r=2}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 1.02 | Template:Round |
{{Inflation|US|1|2017|2018|r=3}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 1.024 | Template:Round |
{{Inflation|US|0.96|2017|2018|r=1}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 1 | Template:Round |
{{Inflation|US|0.96|2017|2018|r=2}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 0.98 | Template:Round |
{{Inflation|US|0.96|2017|2018|r=3}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 0.983 | Template:Round |
Equivalence
{{Inflation|US|96|2017|2018|fmt=eq|r=0}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| equivalent to $98 in 2018 | equivalent to $Template:Round in 2018 |
{{Inflation|US|96|2017|2018|fmt=eqm|r=0}}
| {{Inflation}} | {{Inflation/sandbox}} |
|---|---|
| 98 | equivalent to $Template:Round million in 2018 |
Wrapping with Template:format price
${{Format price|{{Inflation|US-GDP|10000000000000|1900}}}}→ $259 trillion
${{Format price|{{Inflation|US-GDP|1000000|1990}}}}→ $1.76 million
DM {{Format price|{{Inflation|DE|1000000|1957|1978}}}}→ DM 2.01 million
£{{Format price|{{Inflation|UK-GDP|1000|1323}}}}→ £662 thousand
sandbox:
${{Format price|{{Inflation/sandbox|US-GDP|10000000000000|1900}}}}→ $Format price error: cannot parse value "Template:Round"
${{Format price|{{Inflation/sandbox|US-GDP|1000000|1990}}}}→ $Format price error: cannot parse value "Template:Round"
DM {{Format price|{{Inflation/sandbox|DE|1000000|1957|1978}}}}→ DM Format price error: cannot parse value "Template:Round"
£{{Format price|{{Inflation/sandbox|UK-GDP|1000|1323}}}}→ £Format price error: cannot parse value "Template:Round"
Other test cases
| Very large amount of money |
|---|
{{Inflation|US|25000000000|2010}}
{{Inflation}} 29311002594 |
References
- ↑ UK Retail Price Index inflation figures are based on data from Clark, Gregory (2017). "The Annual RPI and Average Earnings for Britain, 1209 to Present (New Series)". MeasuringWorth. Retrieved February 2, 2020.