在flash中16进制转换为10进制 flashflexactionscript
程序员文章站
2022-05-05 22:06:01
...
function strToD(num:String="",n:Number=2){
var nums:Array = num.split("");
var d=0;
for(var i=0;i<nums.length;i++){
var number=int(nums[i]);
var power=Math.pow(n,(nums.length-(i+1)));
d+=number*power;
}
return d;
}
http://bbs.9ria.com/thread-62938-1-1.html
var nums:Array = num.split("");
var d=0;
for(var i=0;i<nums.length;i++){
var number=int(nums[i]);
var power=Math.pow(n,(nums.length-(i+1)));
d+=number*power;
}
return d;
}
http://bbs.9ria.com/thread-62938-1-1.html