createCol(n: number) {
const ordA = 'A'.charCodeAt(0)
const ordZ = 'Z'.charCodeAt(0)
const len = ordZ - ordA + 1
let str = ""
while (n >= 0) {
str = String.fromCharCode(n % len + ordA) + str
n = Math.floor(n / len) - 1
}
return str
}
JS 数字转换为EXCEL字母列
最新推荐文章于 2024-07-03 11:22:14 发布