Skip to content

Latest commit

 

History

History

what-century-is-it

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation.

Examples

"1999" --> "20th"
"2011" --> "21st"
"2154" --> "22nd"
"2259" --> "23rd"
"1124" --> "12th"
"2000" --> "20th"