வார்ப்புரு:Inflation
&lt;includeonly&gt;{{&lt;!--
 1: if a mandatory field is unspecified, return error, else next test
 --&gt;#ifexpr:
     {{#if:{{{value|{{{2|}}}}}}|0|1}}
     or {{#if:{{{start_year|{{{3|}}}}}}|0|1}}
    |&lt;span class=&quot;error&quot;&gt;Error when using {{tl|Inflation}}:&lt;!--
  --&gt; {{Separated entries|separator=,&amp;#32;|conjunction=&amp;#32;and&amp;#32;
      |{{#if:{{{index|{{{1|}}}}}}||{{para|index}} (parameter 1)}}
      |{{#if:{{{value|{{{2|}}}}}}||{{para|value}} (parameter 2)}}
      |{{#if:{{{start_year|{{{3|}}}}}}||{{para|start_year}} (parameter 3)}}
      }} must be specified.&lt;/span&gt;&lt;!--
  --&gt;{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}&lt;!--
 
 --&gt;|{{&lt;!--
 2: if index code is unrecognized, return error, else next test
  --&gt;#ifexpr:
      not(
       {{#ifexist:Template:Inflation/{{{index|{{{1}}}}}}|1|0}}
       and {{Isnumeric|{{Inflation/year|{{{index|{{{1}}}}}}}}|boolean=true}}
      )
     |&lt;span class=&quot;error&quot;&gt;Error when using {{tl|Inflation}}:&lt;!--
   --&gt; {{para|index|'''{{{index|{{{1}}}}}}'''}} (parameter 1) not a recognized index.&lt;/span&gt;&lt;!--
   --&gt;{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}&lt;!--
 
  --&gt;|{{&lt;!--
 3: if a numeric parameter contain invalid data, return error, else next test
   --&gt;#ifexpr:
       not(
        {{Isnumeric|{{{value|{{{2}}}}}}|boolean=true}}
        and {{Isnumeric|{{{start_year|{{{3}}}}}}|boolean=true}}
        and {{#if: {{{end_year|{{{4|}}}}}} | {{Isnumeric|{{{end_year|{{{4}}}}}}|boolean=true}} | 1 }}
        and {{#if: {{{r|}}} | {{Isnumeric|{{{r}}}|boolean=true}} | 1 }}
       )
      |&lt;span class=&quot;error&quot;&gt;Error when using {{tl|Inflation}}:&lt;!--
    --&gt; [[NaN]], check parameters for non-numeric data:&lt;!--
    --&gt; {{Separated entries|separator=,&amp;#32;|conjunction=&amp;#32;and&amp;#32;
        |{{Ifnumber|{{formatnum:{{{value|{{{2}}}}}}|R}}||{{para|value|'''{{{value|{{{2}}}}}}'''}} (parameter 2)}}
        |{{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)}} }}
        |{{#if: {{{r|}}} | {{Ifnumber|{{formatnum:{{{r}}}|R}}||{{para|r|'''{{{r}}}'''}}}} }}
        }}.&lt;/span&gt;&lt;!--
    --&gt;{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}&lt;!--
 
   --&gt;|{{&lt;!--
 4: if a parameter is out of calculable bounds, return error, else proceed
    --&gt;#ifexpr:
        not(
         ( {{{start_year|{{{3}}}}}} &gt;= {{Inflation/{{{index|{{{1}}}}}}/startyear}} )
         and(
          ( {{{start_year|{{{3}}}}}} &lt;= {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} )
          or ( {{{start_year|{{{3}}}}}} = {{{end_year|{{{4|{{CURRENTYEAR}}}}}}}} )
         )
         and ( {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} &lt;= {{Inflation/year|{{{index|{{{1}}}}}}}} )
        )
       |&lt;span class=&quot;error&quot;&gt;Error when using {{tl|Inflation}}:&lt;!--
     --&gt; {{Separated entries|separator=,&amp;#32;|conjunction=&amp;#32;and&amp;#32;
         |{{&lt;!-- 4a: [parameter 3/start_year] too low --&gt;
          #ifexpr: {{{start_year|{{{3}}}}}} &lt; {{Inflation/{{{index|{{{1}}}}}}/startyear}}
          |{{para|start_year|'''{{{start_year|{{{3}}}}}}'''}} (parameter 3)&lt;!--
        --&gt; is lower than the earliest available year ('''{{Inflation/{{{index|{{{1}}}}}}/startyear}}''')&lt;!--
        --&gt; in index &quot;'''{{{index|{{{1}}}}}}'''&quot;&lt;!--
       --&gt;}}
         |{{&lt;!-- 4b: [parameter 3/start_year] greater than [parameter 4/end_year]
                 ...and not equal to {{CURRENTYEAR}} if [parameter 4/end_year] is unspecified --&gt;
          #ifexpr:
           ( {{{start_year|{{{3}}}}}} &gt; {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} )
           and ( {{{start_year|{{{3}}}}}} != {{{end_year|{{{4|{{CURRENTYEAR}}}}}}}} )
          |{{para|start_year|'''{{{start_year|{{{3}}}}}}'''}} (parameter 3)&lt;!--
        --&gt; is greater than&lt;!--
        --&gt; {{&lt;!--
         --&gt;#if:{{{end_year|{{{4|}}}}}}&lt;!--
         --&gt;|{{para|end_year|'''{{{end_year|{{{4}}}}}}'''}} (parameter 4)&lt;!--
         --&gt;|the latest available year ('''{{Inflation/year|{{{index|{{{1}}}}}}}}''')&lt;!--
          --&gt; in index &quot;'''{{{index|{{{1}}}}}}'''&quot;&lt;!--
         --&gt;}}&lt;!--
       --&gt;}}
         |{{&lt;!-- 4c: [parameter 4/end_year] greater than [parameter 1/index] highest year --&gt;
          #ifexpr: {{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}} &gt; {{Inflation/year|{{{index|{{{1}}}}}}}}
          |{{para|end_year|'''{{{end_year|{{{4}}}}}}'''}} (parameter 4)&lt;!--
        --&gt; is greater than the latest available year ('''{{Inflation/year|{{{index|{{{1}}}}}}}}''')&lt;!--
        --&gt; in index &quot;'''{{{index|{{{1}}}}}}'''&quot;&lt;!--
       --&gt;}}&lt;!--
      --&gt;}}.&lt;/span&gt;&lt;!--
     --&gt;{{#if:{{{nocat|}}}||{{main other|[[Category:Pages with errors in inflation template]]}}}}&lt;!--
 
    --&gt;|&lt;!--
 begin template proper
 --&gt;{{#ifeq:{{{orig|}}}|yes|{{{cursign|$}}}{{{2}}} (}}{{#ifeq:{{{fmt|raw}}}|eq|equivalent to {{{cursign|$}}}}}&lt;!--
 --&gt;{{formatnum:
     {{
     #iferror:
      {{#invoke:Math|round|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}}}}}
     |&lt;span class=&quot;error&quot;&gt;Error when using {{tl|Inflation}}:&lt;!--
   --&gt; [[NaN]]/calculation error, please notify [[Template talk:Inflation]].&lt;/span&gt;&lt;!--
   --&gt;{{main other|[[Category:Pages with errors in inflation template]]}}&lt;!--
      this error indicates template bug, always categorize
  --&gt;}}
    |{{#ifeq:{{{fmt|raw}}}|raw|R|}}
    }}&lt;!--
 --&gt;{{#ifeq:{{{fmt|raw}}}|eq|&amp;#32;in&lt;!--
  --&gt; {{&lt;!--
   --&gt;#ifeq:{{{start_year|{{{3}}}}}}|{{CURRENTYEAR}}&lt;!--
   --&gt;|{{CURRENTYEAR}}&lt;!--
   --&gt;|{{{end_year|{{{4|{{Inflation/year|{{{index|{{{1}}}}}}}}}}}}}}&lt;!--
   --&gt;}}&lt;!--
 --&gt;}}&lt;!--
 end template proper
 
    --&gt;}}&lt;!-- 4
   --&gt;}}&lt;!-- 3
  --&gt;}}&lt;!-- 2
 --&gt;}}&lt;!-- 1 --&gt;{{#ifeq:{{{orig|}}}|yes|)}}&lt;/includeonly&gt;&lt;noinclude&gt;
 {{Documentation}}