这个问题我一直用EXCEL自带函数搞定,因为速度比较快些,特别是大规模转换时,在单元格A1中填上要转换的数字
=IF(A1=0,"(人民币)零元",IF(A1<0,TEXT(INT(ABS(A1)),"(人民币)负[DBNum2]g/通用格式")&"元"&IF((INT(ABS(A1)*10)-INT(ABS(A1))*10)=0,"",TEXT(INT(ABS(A1)*10)-INT(ABS(A1))*10,"[DBNum2]")&"角")&IF((INT(ABS(A1)*100)-INT(ABS(A1)*10)*10)=0,"整",IF(INT(ABS(A1)*10)-INT(ABS(A1))*10=0,"零","")&TEXT(INT(ABS(A1)*100)-INT(ABS(A1)*10)*10,"[DBNum2]")&"分"),TEXT(INT(A1),"(人民币)[DBNum2]g/通用格式")&"元"&IF(INT(A1*10)-INT(A1)*10=0,"",TEXT(INT(A1*10)-INT(A1)*10,"[dbnum2]")&"角")&IF((INT(A1*100)-INT(A1*10)*10)=0,"整",IF(INT(A1*10)-INT(A1)*10=0,"零","")&TEXT(INT(A1*100)-INT(A1*10)*10,"[DBNum2]")&"分"))) |