MCPcopy Create free account
hub / github.com/Tatamo/atcoder-cli / convertNumber2Alphabet

Function convertNumber2Alphabet

src/project.ts:279–286  ·  view source on GitHub ↗

* 数値をアルファベットに変換する * 0,1,2,... => a,b,c,...,z,aa,ab,... * @param num

(num: number)

Source from the content-addressed store, hash-verified

277 * @param num
278 */
279function convertNumber2Alphabet(num: number): string {
280 if (num < 0) throw new Error("invalid number");
281 let result = "";
282 do {
283 result = ((num % 26) + 10).toString(36) + result;
284 } while ((num = Math.floor(num / 26) - 1) >= 0);
285 return result;
286}

Callers 1

convertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected