在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
从网上找的一段代码 /// <summary> /// 小写转大写 /// </summary> /// <param name="mmje"></param> /// <returns></returns> function MoneyConvert(mmje: real): string; const s1: string = '零壹贰叁肆伍陆柒捌玖'; s2: string = '分角元拾佰仟万拾佰仟亿拾佰仟万'; function StrTran(const S, s1, s2: string): string; begin Result := StringReplace(S, s1, s2, [rfReplaceAll]); end; var S, dx: string; i, Len: Integer; begin if mmje < 0 then begin dx := '负'; mmje := -mmje; end; S := Format('%.0f', [mmje * 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); dx := StrTran(StrTran(StrTran(StrTran(StrTran(dx, '零仟', '零'), '零佰', '零'), '零拾', '零'), '零角', '零'), '零分', '整'); dx := StrTran(StrTran(StrTran(StrTran(StrTran(dx, '零零', '零'), '零零', '零'), '零亿', '亿'), '零万', '万'), '零元', '元'); if dx = '整' then Result := '零元整' else Result := StrTran(StrTran(dx, '亿万', '亿零'), '零整', '整'); end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论