function creatRandomNum(n){ var Random = 0; RandomCeil = Math.ceil(Math.random()*Math.pow(10,n)); RandomVar = RandomCeil / Math.pow(10,n); //RandomVar为RandomCeil对应的正整数 //n为指定的位数 return {"RandomCeil":RandomCeil,"RandomVar":RandomVar}; }
function creatRandomNum(n){ var Random = 0; RandomCeil = Math.ceil(Math.random()*Math.pow(10,n)); RandomVar = RandomCeil / Math.pow(10,n); //RandomVar为RandomCeil对应的正整数 //n为指定的位数 return {"RandomCeil":RandomCeil,"RandomVar":RandomVar}; }