Created
March 9, 2017 08:36
-
-
Save idealwebsolutions/b99ce47cf9bfafe2bc78b5d383696173 to your computer and use it in GitHub Desktop.
Get century from year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function centuryFromYear(year) { | |
return year % 100 === 0 ? Math.trunc(year / 100) : Math.trunc(year / 100) + 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment