Created
March 28, 2017 07:25
-
-
Save zazanik/454f9db503bbd99a9a4c14a0b74cf392 to your computer and use it in GitHub Desktop.
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
/****************************************************** | |
* Get Letter by number | |
****************************************************** | |
* @param number {number} | |
* @returns {string} | |
******************************************************/ | |
function getLetterByNumber(number) { | |
return (number >= 26 ? idOf((number / 26 >> 0) - 1) : '') + 'abcdefghijklmnopqrstuvwxyz'[number % 26 >> 0]; | |
} | |
getLetterByNumber(1) //b | |
getLetterByNumber(27) //aa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment