Templat:Inflasi: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Glorious Engine (bicara | kontrib)
Tidak ada ringkasan suntingan
NikolasKHF (bicara | kontrib)
kTidak ada ringkasan suntingan
 
(9 revisi perantara oleh 6 pengguna tidak ditampilkan)
Baris 1:
<includeonly>{{<!--
{{
1: if a mandatory field is unspecified, return error, else next test
#switch: {{padleft:|1|{{{2|8}}}x|}}
-->#ifexpr:
|0|1|2|3|4|5|6|7|8|9 =
{{#if:{{{value|{{{2|}}}}}}|0|1}}
| #default =
or {{#if:{{{start_year|{{{3|}}}}}}|0|1}}
<br><span class="error">{Inflation} - Amount must not have <!--
|<span class="error">Error when using {{tl|Inflation}}:<!--
-->"{{padleft:|1|{{{2|$8}}}x|}}" prefix:</span><!--
--> {{Separated entries|separator=,&#32;|conjunction=&#32;and&#32;
-->&nbsp;{{{2|$8}}}.&nbsp;&nbsp;
|{{#if:{{{index|{{{1|}}}}}}||{{para|index}} (parameter 1)}}
}}{{
|{{#if:{{{value|{{{2|}}}}}}||{{para|value}} (parameter 2)}}
#ifexpr: ({{{3|2012}}}) < ({{Inflation/{{{1|US}}}/startyear}})
|{{#if:{{{start_year|{{{3|}}}}}}||{{para|start_year}} (parameter 3)}}
|<br><span class="error">{Inflation} - Year: </span>{{{3}}}<!--
--> }} must be specified.</span class="error">lower than<!--
-->{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}<!--
--> {{{1|US}}} minimum, {{Inflation/{{{1|US}}}/startyear}},<!--
 
--> for amount:</span>&nbsp;{{{2|8}}}.&nbsp;
-->|{{<!--
}}{{
2: if index code is unrecognized, return error, else next test
#ifexpr: ({{{3|2012}}}) > ({{{4|{{CURRENTYEAR}} }}})
-->#ifexpr:
|<br><span class="error">{Inflation} - Start year: {{{3}}}<!--
not(
--> greater than end year, {{{4|{{CURRENTYEAR}} }}}<!--
--> for amount{{#ifexist:<Template:Inflation/span> {{{2index|8{{{1}}}.&nbsp;}}}|1|0}}
and {{Isnumeric|{{Inflation/year|{{{index|{{{1}}}}}}}}|boolean=true}}
}}{{
)
#ifexpr: ({{{4|{{CURRENTYEAR}} }}}) > {{CURRENTYEAR}}
|<br><span class="error">{Inflation}Error -when Endusing year: </b>{{{4tl|Inflation}}}<b>:<!--
--> {{para|index|'''{{{index|{{{1}}}}}}'''}} (parameter 1) not a recognized index.</span><!--
--> greater than current year, {{CURRENTYEAR}}<!--
-->{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}<!--
--> for amount:</span> {{{2|8}}}.&nbsp;
 
}}{{#ifeq:{{{fmt|raw}}}|eq
-->|{{<!--
|setara dengan {{{cursign|$}}}
3: if a numeric parameter contain invalid data, return error, else next test
}}{{formatnum:{{
-->#ifexpr:
#iferror:{{
not(
#ifexpr:({{{3|2012}}})>=({{Inflation/{{{1|US}}}/startyear}})
and ({ {{3Isnumeric|2012}}}) <= ({{{4value|{{CURRENTYEAR{2}}}}})}|boolean=true}}
and ({{Isnumeric|{4{{start_year|{{CURRENTYEAR{3}}}}}) <}|boolean= {{CURRENTYEARtrue}}
and {{#if: {{{end_year|{{{4|}}}}}} | {{Isnumeric|{{{end_year|{{{4}}}}}}|boolean=true}} | 1 }}
|<!--then decomma & calculate-->{{
and {{#exprif:( {{formatnum:{r|}}} | {{2Isnumeric|8,000{{{r}}}|Rboolean=true}} )| 1 }}
)
{{Inflation/{{{1|US}}}|{{{3|1980}}}|{{{4|{{CURRENTYEAR}}}}}}}
|<span class="error">Error when roundusing ({{{rtl|0}}}) Inflation}}:<!--
--> [[NaN]], check parameters for non-numeric data:<!--
|[[NaN]]
--> {{Separated entries|separator=,&#32;|conjunction=&#32;and&#32;
}}
|{{Ifnumber|{{formatnum:{{{value|{{{2}}}}}}|R}}||{{para|value|'''{{{value|{{{2}}}}}}'''}} (parameter 2)}}
|{Inflation} - [[NaN]], check amount: {{{2}}} or year: {{{3}}}.&nbsp;
|{{Ifnumber|{{formatnum:{{{start_year|{{{3}}}}}}|R}}||{{para|start_year|'''{{{start_year|{{{3}}}}}}'''}} (parameter 3)}}
}}|{{
|{{#if: {{{end_year|{{{4|}}}}}} | {{Ifnumber|{{formatnum:{{{end_year|{{{4}}}}}}|R}}||{{para|end_year|'''{{{end_year|{{{4}}}}}}'''}} (parameter 4)}} }}
#ifeq:{{{fmt|raw}}}|raw|R|}}
|{{#if: {{{r|}}} | {{Ifnumber|{{formatnum:{{{r}}}|R}}||{{para|r|'''{{{r}}}'''}}}} }}
}}{{#ifeq:{{{fmt|raw}}}|eq
}}.</span><!--
|&#32;pada {{{4|{{CURRENTYEAR}}|}}}
-->{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}<!--
}}<noinclude>
 
{{Documentation}}</noinclude>
-->|{{<!--
4: if a parameter is out of calculable bounds, return error, else proceed
-->#ifexpr:
not(
( {{{start_year|{{{3}}}}}} >= {{Inflation/{{{index|{{{1}}}}}}/startyear}} )
and(
( {{{start_year|{{{3}}}}}} <= {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} )
or ( {{{start_year|{{{3}}}}}} = {{{end_year|{{{4|{{CURRENTYEAR}}}}}}}} )
)
and ( {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} <= {{Inflation/year|{{{index|{{{1}}}}}}}} )
)
|<span class="error">Error when using {{tl|Inflation}}:<!--
--> {{Separated entries|separator=,&#32;|conjunction=&#32;and&#32;
|{{<!-- 4a: [parameter 3/start_year] too low -->
#ifexpr: {{{start_year|{{{3}}}}}} < {{Inflation/{{{index|{{{1}}}}}}/startyear}}
|{{para|start_year|'''{{{start_year|{{{3}}}}}}'''}} (parameter 3)<!--
--> is lower than the earliest available year ('''{{Inflation/{{{index|{{{1}}}}}}/startyear}}''')<!--
--> in index "'''{{{index|{{{1}}}}}}'''"<!--
-->}}
|{{<!-- 4b: [parameter 3/start_year] greater than [parameter 4/end_year]
...and not equal to {{CURRENTYEAR}} if [parameter 4/end_year] is unspecified -->
#ifexpr:
( {{{start_year|{{{3}}}}}} > {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} )
and ( {{{start_year|{{{3}}}}}} != {{{end_year|{{{4|{{CURRENTYEAR}}}}}}}} )
|{{para|start_year|'''{{{start_year|{{{3}}}}}}'''}} (parameter 3)<!--
--> is greater than<!--
--> {{<!--
-->#if:{{{end_year|{{{4|}}}}}}<!--
-->|{{para|end_year|'''{{{end_year|{{{4}}}}}}'''}} (parameter 4)<!--
-->|the latest available year ('''{{Inflation/year|{{{index|{{{1}}}}}}}}''')<!--
--> in index "'''{{{index|{{{1}}}}}}'''"<!--
-->}}<!--
-->}}
|{{<!-- 4c: [parameter 4/end_year] greater than [parameter 1/index] highest year -->
#ifexpr: {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} > {{Inflation/year|{{{index|{{{1}}}}}}}}
|{{para|end_year|'''{{{end_year|{{{4}}}}}}'''}} (parameter 4)<!--
--> is greater than the latest available year ('''{{Inflation/year|{{{index|{{{1}}}}}}}}''')<!--
--> in index "'''{{{index|{{{1}}}}}}'''"<!--
-->}}<!--
-->}}.</span><!--
-->{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}<!--
 
-->|<!--
begin template proper
-->{{#ifeq:{{{fmt|raw}}}|eq|setara dengan {{{cursign|$}}}}}<!--
-->{{formatnum:
{{
#iferror:
{{decimals|1={{
#expr:
{{formatnum:{{{value|{{{2}}}}}}|R}}
{{#ifeq:{{{start_year|{{{3}}}}}}|{{CURRENTYEAR}}
| * 1
| {{Inflation/{{{index|{{{1}}}}}}|{{{start_year|{{{3}}}}}}|{{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}}}}
}}
round {{{r|0}}}
}}|2={{{r|0}}}}}
|<span class="error">Error when using {{tl|Inflation}}:<!--
--> [[NaN]]/calculation error, please notify [[Template talk:Inflation]].</span><!--
-->{{main other|[[Category:Pages with errors in inflation template]]}}<!--
this error indicates template bug, always categorize
-->}}
|{{#ifeq:{{{fmt|raw}}}|raw|R|}}
}}<!--
-->{{#ifeq:{{{fmt|raw}}}|eq|&#32;pada<!--
--> {{<!--
-->#ifeq:{{{start_year|{{{3}}}}}}|{{CURRENTYEAR}}<!--
-->|{{CURRENTYEAR}}<!--
-->|{{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}}<!--
-->}}<!--
-->}}<!--
end template proper
 
-->}}<!-- 4
-->}}<!-- 3
-->}}<!-- 2
-->}}<!-- 1 --></includeonly><noinclude>
{{Documentation}}
</noinclude>