Skip to content

Instantly share code, notes, and snippets.

@zazanik
Created March 28, 2017 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zazanik/454f9db503bbd99a9a4c14a0b74cf392 to your computer and use it in GitHub Desktop.
Save zazanik/454f9db503bbd99a9a4c14a0b74cf392 to your computer and use it in GitHub Desktop.
/******************************************************
* 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