编辑“︁
Template:Inflation/doc
”︁(章节)
跳转到导航
跳转到搜索
这是
Inflation
模板的
文档页面
。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
==== 提示與技巧 ==== ===== 貨幣轉換 ===== 此模板不能轉換貨幣單位,因此,如果想知道1960時的1000德國馬克於現在的價值,輸入{{tlx|Inflation|DE|1000|1960|r{{=}}2}}顯示的數值仍爲德國馬克,而非歐元。 所以,如要轉換貨幣單位,需要手動輸入數式,下面例子定義€ 1 = DM 1.95583: * {{aye}} <tt><nowiki>{{#expr:</nowiki>({{tlx|Inflation|DE|1000|1960|r{{=}}2}}<nowiki> / 1.95583) round 2}}</nowiki></tt> ===== 四捨五入 ===== {{para|r}}參數可以定義要四捨五入的數位,輸入{{para|r|2}}會約至2個小數點;輸入{{para|r|-3}}會約至千位;輸入{{para|r|-6}}會約至百萬位,如此類推。 ===== Formatnum ===== 為達到更佳效果,編者可以使用<tt><nowiki>{{</nowiki>[[Help:魔術字|formatnum:]]<nowiki>}}</nowiki></tt>,用{{tlx|Formatprice}}也可。這個功能為數值每三個數位加上一個分隔逗號,但編者不能控制顯示多少小數位。 * {{aye}} <tt>'''DM''' <nowiki>{{formatnum:</nowiki>{{tlx|Inflation|DE|1000000|1957|1978}}<nowiki>}}</nowiki>'''.00'''</tt> = DM {{formatnum:{{Inflation|DE|1000000|1957|1978}}}}.00 * {{aye}} <tt>'''£'''<nowiki>{{formatnum:</nowiki>{{tlx|Inflation|UK|1000000|1323|1978|r{{=}}-4}}<nowiki>}}</nowiki></tt> = £{{formatnum:{{Inflation|UK|1000000|1323|1978|r=-4}}}} * {{aye}} <tt>'''$'''<nowiki>{{formatnum:</nowiki>{{tlx|Inflation|US|1000000|1990|r{{=}}2}}<nowiki>}}</nowiki></tt> = ${{formatnum:{{Inflation|US|1000000|1990|r=2}}}} {{TransH}} Another potential source of difficulties resides in the way certain calculated values are expressed. In many cases the result comes as a number in engineering units ("1.2E+9" instead of "1200000000"), and when that happens <tt><nowiki>{{</nowiki>[[Help:Magic words#Formatting|formatnum:]]<nowiki>}}</nowiki>'ing</tt> the result fails. A workaround then is to express the value to be inflated with fewer digits, adding a multiplier text such as "million" after the result, and then hitting the "Show preview" button as many times as needed, changing parameters until the best result is found: * {{nay}} <tt>'''$'''<nowiki>{{formatnum:</nowiki>{{tlx|Inflation|US|1000000000|1900|r{{=}}-8}}<nowiki>}}</nowiki></tt> = ${{formatnum:{{Inflation|US|1000000000|1900|r=-8}}}} * {{nay}} <tt>'''$'''<nowiki>{{formatnum:</nowiki>{{tlx|Inflation|US|1000000|1900|r{{=}}-5}}<nowiki>}}</nowiki> ''thousand''</tt> = ${{formatnum:{{Inflation|US|1000000|1900|r=-5}}}} thousand * {{aye}} <tt>'''$'''<nowiki>{{formatnum:</nowiki>{{tlx|Inflation|US|1000|1900|r{{=}}-2}}<nowiki>}}</nowiki> ''million''</tt> = ${{formatnum:{{Inflation|US|1000|1900|r=-2}}}} million * {{aye}} <tt>'''$'''<nowiki>{{formatnum:</nowiki>{{tlx|Inflation|US|1|1900|r{{=}}1}}<nowiki>}}</nowiki> ''billion''</tt> = ${{formatnum:{{Inflation|US|1|1900|r=1}}}} billion The following section provides an automated way of avoiding this trial and error scenario. ===== Formatprice ===== {{tlx|Formatprice}} is a template specifically designed to display price values, both big and small, in a more pleasant way than <tt><nowiki>{{</nowiki>[[Help:Magic words#Formatting|formatnum:]]<nowiki>}}</nowiki></tt> allows for. For example, instead of showing the whole of a huge number such as "953,783,409,856.12", it would show it as "{{Formatprice|953783409856.12}}", while small numbers have their cents part appearing as expected, "1234.5" being properly shown as "{{Formatprice|1234.5}}". On the down side, {{tlx|Formatprice}} has no built-in intelligent handling of user locale settings, which means that some users might see a dot or a comma the opposite way they'd expect. As a general rule of thumb this shouldn't be a serious concern though, as most numbers in Wikipedia are hand-written anyway and will show as entered regardless of user settings. * {{aye}} <tt>'''DM''' <nowiki>{{</nowiki>[[Template:Formatprice|Formatprice]]<nowiki>|</nowiki>{{tlx|Inflation|DE|1000000|1957|1978}}<nowiki>}}</nowiki></tt> = DM {{Formatprice|{{Inflation|DE|1000000|1957|1978}}}} * {{aye}} <tt>'''£'''<nowiki>{{</nowiki>[[Template:Formatprice|Formatprice]]<nowiki>|</nowiki>{{tlx|Inflation|UK|1000000|1323|1978|r{{=}}-4}}<nowiki>}}</nowiki></tt> = £{{Formatprice|{{Inflation|UK|1000000|1323|1978|r=-4}}}} * {{aye}} <tt>'''$'''<nowiki>{{</nowiki>[[Template:Formatprice|Formatprice]]<nowiki>|</nowiki>{{tlx|Inflation|US|1000000|1990|r{{=}}2}}<nowiki>}}</nowiki></tt> = ${{Formatprice|{{Inflation|US|1000000|1990|r=2}}}} * {{aye}} <tt>'''$'''<nowiki>{{</nowiki>[[Template:Formatprice|Formatprice]]<nowiki>|</nowiki>{{tlx|Inflation|US|1000000000|1900|r{{=}}-8}}<nowiki>}}</nowiki></tt> = ${{Formatprice|{{Inflation|US|1000000000|1900|r=-8}}}} ===== Documenting ===== It's a good practice to provide a valid reference for the prices calculated with this template in the articles where it's used. The template {{tl|Inflation/fn|country}} was developed to ease this task. It accepts as its single parameter the same country codes used here, and will generate one or more appropriate footnotes. Typically, this is how a piece of text using it looks like: * <tt><nowiki>In 1910 a ''blah'' cost on average £1,000. This is equivalent to £{{Formatprice|{{Inflation|</nowiki>'''UK'''<nowiki>|1000|1910|r=2}}}} in present day </nowiki>{{Nowrap|terms.<nowiki>{{Inflation/fn|</nowiki>'''UK'''<nowiki>}}</nowiki>}}</tt> Resulting in this converted code (notice the footnote link at the end): * In 1910 a ''blah'' cost on average £1,000. This is equivalent to £{{Formatprice|{{Inflation|UK|1000|1910|r=2}}}} in present day terms.{{Inflation/fn|UK}} The footnote thus generated appears whenever {{tlx|reflist}} or <tt><nowiki><references /></nowiki></tt> is used in an article, usually in its "References" section. See below for the live example in this document's own [[Template:Inflation#References|References]] section, or click the above generated footnote to jump to it.
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息