உள்ளடக்கத்துக்குச் செல்

வார்ப்புரு:Is century/doc

விக்கிமூலம் இலிருந்து

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|}}

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

[தொகு]
{{is century|19ஆம் நூற்றாண்டு }}

1899

{{is century|input=19ஆம் நூற்றாண்டு }}

1899

{{is century|input=19ஆம் நூற்றாண்டு |function=0}}

1899

{{is century|input=19th century BCE|function=0}}

1899 BCE

{{is century|input=19th century|function=1}}

FALSE

{{is century|input=1st century|function=1}}

FALSE

{{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}}

FALSE

{{is century|input=1st century|function=2}}

FALSE

{{is century|input=1st century BCE|function=2}}

1

{{is century|input=19th century BCE|function=2}}

19

{{is century|input=19th century|function=3}}

0

{{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

குறிப்பு

[தொகு]

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}}}}


{{is number|{{is century|input=Foo|function=2}}}}


மேலும் பார்க்க

[தொகு]


"https://ta.wikisource.org/w/index.php?title=வார்ப்புரு:Is_century/doc&oldid=1113724" இலிருந்து மீள்விக்கப்பட்டது