js阿拉伯数字换罗马数字

   
function toroman(num){			if(isnan(num)) return num;						var a=[["","i","ii","iii","iv","v","vi","vii","viii","ix"],                          ["","x","xx","xxx","xl","l","lx","lxx","lxxx","xcc"],                          ["","c","cc","ccc","cd","d","dc","dcc","dccc","cm"]];			var roman = "";			var t=0;			for(var m=0, i=1000; m<3; m++,i/=10){             	t=math.floor((num%i)/(i/10));            	roman += a[2-m][t];            }			return roman;		}
  

你可能感兴趣的:(java,工作)