Function Rmb2Dx

function rmb2dx(rmbje:Double):String; // 人民币转换成为大写 const s1:AnsiString='零壹贰叁肆伍陆柒捌玖'; s2:AnsiString='分角圆拾佰仟万拾佰仟亿拾佰仟万'; var s,dx:String; i,Len:Integer; function StrTran(const S,S1,S2:String):String; begin Result:=StringReplace(S,S1,S2,[rfReplaceAll]); end; begin if rmbje<0 then begin dx:='负'; rmbje:=-rmbje; end; s:=Format('%.0f',[rmbje*100]); Len:=Length(s); for i:=1 to Len do dx:=dx+Copy(s1,(Ord(s[i])-Ord('0'))*2+1,2)+Copy(s2,(Len-i)*2+1,2); if dx='' then result:='零分整' else result:=dx+'整'; end;

你可能感兴趣的:(Function Rmb2Dx)