साँचा:Is decade/doc
यह एक साँचा विवरण उपपृष्ठ है, साँचा:Is decade के लिए। इस पन्ने पर ऐसी जानकारियाँ हैं जो, श्रेणीकरण एवं अन्य चीजों से संबंधित हैं जो मूल साँचा पृष्ठ पर नहीं हैं। |
Usage
सम्पादनThis template can be used in other templates to check or analyse an input entered in the the form YYYYs
(ie. the format used in Works by decade, Births by decade and Deaths by decade).
{{is decade|input=|function=}}
The template can be used without named parameters as well. The most basic usage is:
{{is decade|}}
Input
सम्पादनThe input must be in the form of YYYYs
or YYYYs BCE
. The maximum value is 2100s
and the minimum value is 2000s BCE
. The inputs 0s
and 0s BCE
are treated as separate periods (ie. the year 1-10 CE and 1-10 BCE respectively).
Function
सम्पादनThe function must be one of the numbers in this table. This parameter is optional. If not set, function 0 is the default.
Number | Function | Output |
---|---|---|
0 | Basic | Removes the plural "s" from the input. |
1 | Index | Returns a number counting number of decades from 0s .ie.10s = 1, 10s BCE = -1. |
2 | Absolute | Returns the numeric part of the input only. |
3 | Logic | Returns a 1 (one) if the input is a recognised decade. |
If the input is not a recognised decade, this template will return FALSE
; unless function 3 is selected, in which case it will return 0 (zero).
Examples
सम्पादनBasic
सम्पादन{{is decade|1980s}}
1980
{{is decade|input=1980s}}
1980
{{is decade|input=1980s|function=0}}
1980
Index
सम्पादन{{is decade|input=1980s|function=1}}
198
{{is decade|input=0s|function=1}}
0
{{is decade|input=0s BCE|function=1}}
-1
{{is decade|input=1980s BCE|function=1}}
-199
Absolute
सम्पादन{{is decade|input=1980s|function=2}}
1980
{{is decade|input=0s|function=2}}
0
{{is decade|input=0s BCE|function=2}}
0
{{is decade|input=1980s BCE|function=2}}
1980
Logic
सम्पादन{{is decade|input=1980s|function=3}}
1
{{is decade|input=1980|function=3}}
0
Note that the "s" has been removed from the input. This is a year and not a decade.
{{is decade|input=Foo|function=3}}
0
Unrecognised input
सम्पादन{{is decade|input=Foo}}
FALSE
{{is decade|input=Foo|function=3}}
0
Notes
सम्पादनAn alternative form of using function 3 (logic) is to combine this template with {{is number}}.
{{is number|{{is decade|input=1980s|function=2}}}}
1
{{is number|{{is decade|input=Foo|function=2}}}}
See also
सम्पादन- {{is year}}
- {{is century}}