|
刚才翻的时候看到zmud的汉字转数字太麻烦了,把我用的发一下。递归作的,用法@convert(一万零八千)#func convert %eval(%if(%pos(万,%1)>0,@convert(@getleft(%1,万))*10000+@convert(@getright(%1,万)),%if(%pos(千,%1)>0,@convert(@getleft(%1,千))*1000+@convert(@getright(%1,千)),%if(%pos(百,%1)>0,@convert(@getleft(%1,百))*100+@convert(@getright(%1,百)),%if(%pos(十,%1)>0,@convert(%if(@getleft(%1,十)="",一,@getleft(%1,十)))*10+@convert(@getright(%1,十)),(%pos(%1,"一二三四五六七八九")+1)/2)))))#func getleft %if(%pos(%2,%1)>0,%left(%1,%pos(%2,%1)-1),"")#func getright %delete(%1,1,%len(@getleft(%1,%2))+2) |
|