被永久保护的模板

Template:Inflation

维基百科,自由的百科全书
跳到导航 跳到搜索
文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

模板有三個必填參數,包括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] 1946 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|2022|fmt=eq}}相当于2022年的$100
  • Green tickY {{Inflation/year|US}}年的${{Inflation|US|100|2022}}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. The Annual RPI and Average Earnings for Britain, 1209 to Present (New Series). MeasuringWorth. 2017 [June 11, 2022]. 
  7. ^ 1634–1699: McCusker, J. J. 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. 1997.  1700–1799: McCusker, J. J. 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. 1992.  1800–present: Federal Reserve Bank of Minneapolis. Consumer Price Index (estimate) 1800–. [2022-04-16]. 
  8. ^ Johnston, Louis; Williamson, Samuel H. What Was the U.S. GDP Then?. MeasuringWorth. 2022 [2022-02-12].  United States Gross Domestic Product deflator figures follow the Measuring Worth series.