साँचा:Is century/doc
यह एक साँचा विवरण उपपृष्ठ है, साँचा:Is century के लिए। इस पन्ने पर ऐसी जानकारियाँ हैं जो, श्रेणीकरण एवं अन्य चीजों से संबंधित हैं जो मूल साँचा पृष्ठ पर नहीं हैं। |
Usage
सम्पादनThis template can be used in other templates to check or analyse an input entered in the the form Xth century
(ie. the format used in Works by century, Births by century and Deaths by century).
{{is century|input=|function=}}
The template can be used without named parameters as well. The most basic usage is:
{{is century|}}
Input
सम्पादनThe input must be in the form of Xth century
or Xth century BCE
. The maximum value is 21st century
and the minimum value is 20th century BCE
. There is no 0th century
, so this will not work as an input.
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 | Returns the last or first year of the century. (Last if Common Era, first if Before Common Era.) |
1 | Index | Returns a number counting the number of centuries from the 1st century BCE .ie. 1st century BCE = 0, 1st century BCE = 1, 2nd century BCE = -1 |
2 | Absolute | Returns the numeric part of the input only. Note that this will never return 0. |
3 | Logic | Returns a 1 (one) if the input is a recognised century. |
If the input is not a recognised century, this template will return FALSE
; unless function 3 is selected, in which case it will return 0 (zero).
Examples
सम्पादनBasic
सम्पादन{{is century|19th century}}
1899
{{is century|input=19th century}}
1899
{{is century|input=19th century|function=0}}
1899
{{is century|input=19th century BCE|function=0}}
1899 BCE
Index
सम्पादन{{is century|input=19th century|function=1}}
19
{{is century|input=1st century|function=1}}
1
{{is century|input=1st century BCE|function=1}}
0
{{is century|input=19th century BCE|function=1}}
-18
Absolute
सम्पादन{{is century|input=19th century|function=2}}
19
{{is century|input=1st century|function=2}}
1
{{is century|input=1st century BCE|function=2}}
1
{{is century|input=19th century BCE|function=2}}
19
Logic
सम्पादन{{is century|input=19th century|function=3}}
1
{{is century|input=1875|function=3}}
0
This is a year and not a century.
{{is century|input=Foo|function=3}}
0
Unrecognised input
सम्पादन{{is century|input=Foo}}
FALSE
{{is century|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 century|input=19th century|function=2}}}}
1
{{is number|{{is century|input=Foo|function=2}}}}
See also
सम्पादन