js怎么把数字转化为字母(A,B.....AA,AB,..)
function createCellPos( n ){
var ordA = 'A'.charCodeAt(0);
var ordZ = 'Z'.charCodeAt(0);
var len = ordZ - ordA + 1;
var s = "";
while( n >= 0 ) {
s = String.fromCharCode(n % len + ordA) + s;
n = Math.floor(n / len) - 1;
}
return s;
}
createCellPos(26)//"AA"
原文:https://blog.csdn.net/weixin_42349358/article/details/80517198
posted on 2019-02-19 10:52 Cherish_Now 阅读(2826) 评论(0) 收藏 举报
浙公网安备 33010602011771号