获取中文大写金额
function GetChineseMoneyZero(const AMoney: Double): string;
const
Digits: array [0 .. 9] of string = ('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒',
'捌', '玖');
Tens: array [0 .. 4] of string = ('拾', '佰', '仟', '万', '亿');
var
S0: TBytes;
s: string;
Pos, J: Integer;
IsYi: Boolean;
begin
IsYi := false;
S0 := BytesOf(Format('%f', [AMoney]));
Pos := Length(S0);
s := Digits[Ord(S0[Pos]) - $30] + '分';
Pos := Pos - 1;
s := Digits[Ord(S0[Pos]) - $30] + '角' + s;
Pos := Pos - 2;
s := Digits[Ord(S0[Pos]) - $30] + '元' + s;
Pos := Pos - 1;
J := 0;
while Pos > 0 do
begin
s := Digits[Ord(S0[Pos]) - $30] + Tens[J] + s;
Pos := Pos - 1;
J := J + 1;
if (not IsYi) and (J = 4) or (J = 5) then
begin
IsYi := true;
J := 0;
end
else if IsYi and (J = 3) then
J := 4;
end;
Result := s;
end;
无
《学习大师原创文档,请勿转载,侵权必究》