我也来试试, 这不是最短的, 但是是我能独立完成最短的 1.01要说成 1元零1分时 0 零 0.02 贰分 0.5 伍角整 0.21 贰角壹分 25 贰拾伍元整 1.05 壹元零伍分 5.36 伍元叁角陆分 -1.01 负壹元零壹分
=IF(A2<0,"负","")&IF(TRUNC(A2),TEXT(TRUNC(ABS(A2)),"[dbnum2]")&"元","")&SUBSTITUTE(SUBSTITUTE(RIGHT(TEXT(MOD(ABS(A2),1),"[dbnum2]0.0角0分"),4),"零分",IF(A2,"整","零")),"零角",IF((TRUNC(A2)*MOD(A2,1)),"零",""))
=IF(A2<0,"负","")&IF(TRUNC(A2),TEXT(TRUNC(ABS(A2)),"[dbnum2]")&"元","")&SUBSTITUTE(SUBSTITUTE(RIGHT(TEXT(MOD(ABS(A2),1),"[dbnum2]0.0角0分"),4),"零分",IF(A2,"整","零")),"零角",IF((TRUNC(A2)*MOD(A2,1)),"零","")) 不计"=" 197字
1.01 可以说成1元1分时 0 零 0.02 贰分 0.5 伍角整 0.21 贰角壹分 25 贰拾伍元整 1.05 壹元伍分 5.36 伍元叁角陆分 -1.01负壹元壹分 =IF(A2<0,"负","")&IF(TRUNC(A2),TEXT(TRUNC(ABS(A2)),"[dbnum2]")&"元","")&SUBSTITUTE(SUBSTITUTE(RIGHT(TEXT(MOD(ABS(A2),1),"[dbnum2]0.0角0分"),4),"零分",IF(A2,"整","零")),"零角","") 不计"=" 168字 不支持三位小数, 上亿也出错, 请指点, 重在参与与煅练
[此贴子已经被作者于2008-7-29 0:43:50编辑过] |