呢個模包含最少一個可選參數:用之前唔該睇下討論頁


呢個模用咗一啲好複雜嘅語法同好多秘技。響你明嗮佢嘅用途同構造之前,千祈唔好喐佢。亦都要有心理準備要補返嗮改錯咗嘅地方。所有實驗都唔該喺沙盤模,或者你個用戶頁入面搞。

模板有三個必填參數,包括country_codevaluestart_year。通脹率資料可在模板的子頁面找到及編輯,如美國通脹率資料存在Template:Inflation/US/dataset,每年有新的資料,所有引用此模板的頁面便會自動更新。

另外,編者可使用end_year參數,指定某年之間的通脹率。

用法

編輯
{{Inflation|國家代碼|value|start_year}}
{{Inflation|國家代碼|value|start_year|end_year}}
{{Inflation|國家代碼|value|start_year|r=decimals|fmt=c}}
{{Inflation|國家代碼|value|start_year|r=decimals|fmt=eq}}
{{Inflation|國家代碼|value|start_year|r=decimals|fmt=eq|cursign=X}}

此模板支援以下的貨幣:

國家代碼 國家 最早支援年份start_year 最晚支援年份end_year
AU 澳洲[1] 1901 2018
AU-road 澳洲[...?][2] 1998 2018
CA 加拿大[3] 1688 2020
DE 德國[4] 1882 2021
JP 日本[5] 1882 2019
UK 英國[6] 1209 2021
US 美國[7] 1800 2021
US-GDP 美國平均物價指數[8] 1790 2020
  • end_year:如有輸入,數值必須比start_year大,比現時年份小。沒有輸入則預設為今年。
  • r=digit:設定四捨五入至某個數值,預設為0。

例子:


  • Green tickY {{Inflation|DE|1000000|2000}} = 661641
  • Green tickY {{Inflation|US|1000000|2001|2001}} = 相當於2001年嘅$1,000,000
  • Green tickY {{Inflation|US|1000000|1990|2005|r=2}} = 1494905.76
  • Green tickY {{Inflation|UK|1000000|1323|1978|r=-3}} = 114610000
  • Green tickY {{Inflation|JP|100|2000}}102
  • Green tickY {{Inflation|DE|100|2000}}66
  • Green tickY {{Inflation|US|595|1982}}1671
  • Green tickY {{Inflation|US|595|1982|fmt=eq}}相當於2021年嘅$1,671
  • Green tickY {{Inflation|US|800|1942|fmt=eq|r=-3}}相當於2021年嘅$13,000
  • Green tickY {{Inflation|US|100|2010|2012|fmt=eq|r=2}}相當於2012年嘅$105.28
  • Green tickY US$595({{Inflation|US|595|1982|fmt=eq}}US$595(相當於2021年嘅$1,671)
  • Green tickY US$595({{Inflation|US|595|1982|fmt=eq|cursign=[[美元|US$]]}}US$595(相當於2021年嘅US$1,671)
  • Green tickY $2,100萬(相當於{{Inflation/year|US}}的${{Inflation|US|2100|2005|r=0}}$2,100萬(相當於2021年的$2914萬)
  • Green tickY {{Inflation|UK|1|1209|fmt=eq|cursign=£}}相當於2021年嘅£1,499
  • Green tickY {{Inflation|AU|100|2024|fmt=eq}}相當於2024年嘅$100
  • Green tickY {{Inflation/year|US}}年的${{Inflation|US|100|2024}}2021年的$100
  • Green tickY {{Inflation|UK|100|1982|fmt=eq|orig=yes|cursign=£}}相當於2021年嘅£375


參數不當會顯示NaN

  • Red XN {{Inflation}} = 使用{{Inflation}}時出錯: |index= (參數1), |value= (參數2) and |start_year= (參數3) 必須指定。
  • Red XN {{Inflation|abc}} = 使用{{Inflation}}時出錯: |value= (參數2) and |start_year= (參數3) 必須指定。
  • Red XN {{Inflation|DE|1000000}} = 使用{{Inflation}}時出錯: |start_year= (參數3) 必須指定。
  • Red XN {{Inflation|US|1000000|1200|3000}} = 使用{{Inflation}}時出錯: |start_year=1200 (參數3) 低於索引"US"最早可用年(1800)。 and |end_year=3000 (參數4) 大於索引"US"嘅最新可用年(2021).
  • Red XN {{Inflation|UK|1000000|2005|2004}} = 使用{{Inflation}}時出錯: |start_year=2005 (參數3) 大於 |end_year=2004 (參數4).

提示與技巧

編輯
貨幣轉換
編輯

此模板唔可以轉換貨幣單位,因此,如果想知道1960時的1000德國馬克而家嘅價值,輸入{{Inflation|DE|1000|1960|r=2}}顯示嘅數值仲係德國馬克,而非歐元。

所以,如要轉換貨幣單位,需要手動輸入數式,下面例子定義€ 1 = DM 1.95583:

  • Green tickY {{#expr:({{Inflation|DE|1000|1960|r=2}} / 1.95583) round 2}}
四捨五入
編輯

|r=參數可以定義要四捨五入的數位,輸入|r=2會約至2個小數點;輸入|r=-3會約至千位;輸入|r=-6會約至百萬位,如此類推。

Formatnum
編輯

為達到更佳效果,編者可以使用{{formatnum:}},用{{Formatprice}}也可。呢個功能為數值每三個數位加上一個分隔逗號,但編者唔可以控制顯示幾多小數位。

  • Green tickY DM {{formatnum:{{Inflation|DE|1000000|1957|1978}}}}.00 = DM 2,006,102.00
  • Green tickY £{{formatnum:{{Inflation|UK|1000000|1323|1978|r=-4}}}} = £114,610,000
  • Green tickY ${{formatnum:{{Inflation|US|1000000|1990|r=2}}}} = $2,074,121.24

參見

編輯

參考資料

編輯
  1. 1850-1899: McLean, I.W. (1999), Consumer Prices and Expenditure Patterns in Australia 1850–1914. Australian Economic History Review, 39: 1-28. For later years, Australian Consumer Price Inflation figures follow the Long Term Linked Series provided in Australian Bureau of Statistics (2011) 6461.0 – Consumer Price Index: Concepts, Sources and Methods, 2011 as explained at §§3.10–3.11; this series comprises "from 1901 to 1914, the A Series Retail Price Index; from 1914 to 1946–47, the C Series Retail Price Index; from 1946–47 to 1948–49, a combination of the C Series Index, excluding rent, and the housing group of the CPI; and from 1948–49 onwards, the CPI." (3.10). Retrieved 2015-05-04
  2. Inflated values automatically calculated using the "3101 Road and bridge construction Australia" series provided in Australian Bureau of Statistics (2014) 6427.0 – Producer Price Indexes, Australia, Mar 2014: Table 17 Output of the Construction industries, subdivision and class index numbers. Retrieved 14 June 2014.
  3. 1688 to 1923: Geloso, Vincent, A Price Index for Canada, 1688 to 1850 (December 6, 2016). Afterwards, Canadian inflation numbers based on Statistics Canada tables 18-10-0005-01 (formerly CANSIM 326-0021) "Consumer Price Index, annual average, not seasonally adjusted". Statistics Canada. 喺2021-04-17搵到. and table 18-10-0004-13 "Consumer Price Index by product group, monthly, percentage change, not seasonally adjusted, Canada, provinces, Whitehorse, Yellowknife and Iqaluit". Statistics Canada. 喺2021-04-17搵到.
  4. 1500 to 1850: Ulrich Pfister, 2010. "Consumer prices and wages in Germany, 1500 - 1850," CQE Working Papers 1510, Center for Quantitative Economics (CQE), University of Muenster. 1851-1882: Coos Santing, 2007, Inflation 1800-2000, data from OECD, Organisation for Economic Co-operation and Development, Economic Outlook. Historical Statistics and Mitchell, B. R. International Historical Statistics, Africa, Asia and Oceania 1750-1993 London : Macmillan ; New York : Stockton, 1998, International Historical Statistics, Europe 1750-1993 London : Macmillan ; New York : Stockton, 1998, and International Historical Statistics, The Americas 1750-1993 London : Macmillan ; New York : Stockton, 1998. After 1883, German inflation numbers based on data available from the Deutsches Statistisches Bundesamt archive and GENESIS database.
  5. 1868 to 1938: Williamson J., Nominal Wage, Cost of Living, Real Wage and Land Rent Data for Japan 1831-1938, 1939 to 1945: Bank of Japan Historical Statistics Afterwards, Japanese Historical Consumer Price Index numbers based on data available from the Japanese Statistics Bureau. Japan Historical Consumer Price Index (CPI) – 1970 to 2014 Retrieved 30 July 2014. For between 1946 and 1970, from 和戦後史。喺2015-01-24搵到
  6. 6.0 6.1 見英國零售價指數英文Retail Price Index,數據來自Clark, Gregory (2017). "The Annual RPI and Average Earnings for Britain, 1209 to Present (New Series)". MeasuringWorth. 喺June 11, 2022搵到.
  7. 1634–1699: McCusker, J. J. (1997). How Much Is That in Real Money? A Historical Price Index for Use as a Deflator of Money Values in the Economy of the United States: Addenda et Corrigenda (PDF). American Antiquarian Society. 1700–1799: McCusker, J. J. (1992). How Much Is That in Real Money? A Historical Price Index for Use as a Deflator of Money Values in the Economy of the United States (PDF). American Antiquarian Society. 1800–present: Federal Reserve Bank of Minneapolis. "Consumer Price Index (estimate) 1800–". 喺2022-04-16搵到.
  8. Johnston, Louis; Williamson, Samuel H. (2022). "What Was the U.S. GDP Then?". MeasuringWorth. 喺2022-02-12搵到. United States Gross Domestic Product deflator figures follow the Measuring Worth series.