Template:MONTHNUMBER: Difference between revisions

    From Nonbinary Wiki
    mNo edit summary
    mNo edit summary
    Line 1: Line 1:
    <includeonly>{{#if:{{{1|}}}|{{#ifexpr:{{{1|}}}<0|{{#ifexpr:(({{{1|}}}) round 0)!=({{{1|}}})|{{#expr:(((9.5-({{{1|}}}))round 0)mod 12)+1}}|{{#expr:(((8.5-({{{1|}}}))round 0)mod 12)+1}}}}|{{#expr:(((10.5+{{{1|}}})round 0)mod 12)+1}}}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>{{Template documentation}}
    <includeonly>{{#if:{{{1|}}}|{{#ifexpr:{{{1|}}}<0|{{#ifexpr:(({{{1|}}})round 0)!=({{{1|}}})|{{#expr:
      12-(((0.5-({{{1|}}}))round 0)mod 12)
    }}|{{#expr:
      12-(((0.5-({{{1|}}}))round 0)mod 12)
    }}}}|{{#expr:(((10.5+{{{1|}}})round 0)mod 12)+1}}}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>{{Template documentation}}
    This template returns the cyclic integer month number (between 1 and 12) of the month whose real number is in parameter.
    This template returns the cyclic integer month number (between 1 and 12) of the month whose real number is in parameter.
    ; Syntax<nowiki>:</nowiki>
    ; Syntax<nowiki>:</nowiki>

    Revision as of 02:02, 23 April 2006

    Template:Template documentation This template returns the cyclic integer month number (between 1 and 12) of the month whose real number is in parameter.

    Syntax:
    {{MONTHNUMBER|month}}
    • The month value is interpreted modulo 12 (extra leading zeroes are ignored, negative numbers are accepted, all numbers are rounded to floor).
    Examples for all months:
    {{MONTHNUMBER|1}} returns 1
    {{MONTHNUMBER|2}} returns 2
    {{MONTHNUMBER|3}} returns 3
    {{MONTHNUMBER|4}} returns 4
    {{MONTHNUMBER|5}} returns 5
    {{MONTHNUMBER|6}} returns 6
    {{MONTHNUMBER|7}} returns 7
    {{MONTHNUMBER|8}} returns 8
    {{MONTHNUMBER|9}} returns 9
    {{MONTHNUMBER|10}} returns 10
    {{MONTHNUMBER|11}} returns 11
    {{MONTHNUMBER|12}} returns 12
    Examples for months with extra leading zero:
    {{MONTHNUMBER|01}} returns 1
    {{MONTHNUMBER|02}} returns 2
    {{MONTHNUMBER|03}} returns 3
    {{MONTHNUMBER|04}} returns 4
    {{MONTHNUMBER|05}} returns 5
    {{MONTHNUMBER|06}} returns 6
    {{MONTHNUMBER|07}} returns 7
    {{MONTHNUMBER|08}} returns 8
    {{MONTHNUMBER|09}} returns 9
    Examples for month number underflow and overflow, from computed values:
    {{MONTHNUMBER|-12}} returns 11
    {{MONTHNUMBER|-11}} returns 12
    {{MONTHNUMBER|-10}} returns 1
    {{MONTHNUMBER|-9}} returns 2
    {{MONTHNUMBER|-8}} returns 3
    {{MONTHNUMBER|-7}} returns 4
    {{MONTHNUMBER|-6}} returns 5
    {{MONTHNUMBER|-5}} returns 6
    {{MONTHNUMBER|-4}} returns 7
    {{MONTHNUMBER|-3}} returns 8
    {{MONTHNUMBER|-2}} returns 9
    {{MONTHNUMBER|-1}} returns 10
    {{MONTHNUMBER|-0.9999}} returns 11
    {{MONTHNUMBER|-0.5}} returns 11
    {{MONTHNUMBER|-0.0001}} returns 11
    {{MONTHNUMBER|0}} returns 12
    {{MONTHNUMBER|0.0001}} returns 12
    {{MONTHNUMBER|0.5}} returns 12
    {{MONTHNUMBER|0.9999}} returns 12
    {{MONTHNUMBER|12.0001}} returns 12
    {{MONTHNUMBER|12.5}} returns 12
    {{MONTHNUMBER|12.9999}} returns 12
    {{MONTHNUMBER|13}} returns 1
    See also:
    Template:MONTHNAME

    fr:Modèle:MONTHNUMBER