将数字转换大写的函数,改自
这里,原文在Delphi XE8下不能正常转换。
Function MoneyConvert(mmje:real): string;
const
s1: string = ‘零壹贰叁肆伍陆柒捌玖‘;
s2: string = ‘分角元拾佰仟万拾佰仟亿拾佰仟万‘;
Function StrTran(const S, s1, s2: string): string;
begin
Result := S.Replace(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 := s.Length;
for i := 0 to Len-1 do
dx := dx + s1.Substring(Ord(s.Chars[i]) - Ord(‘0‘) , 1) +s2.substring(Len-i-1,1);
dx := StrTra