Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript centuries

function centuryFromYear(year) {
    var x = Math.floor(year / 100);
    if (year % 100 === 0)
        return x;
    else
        return x + 1;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #centuries
ADD COMMENT
Topic
Name
4+2 =