function NumToChar(const n: Real): string; //可以到亿万,并且可以随便扩大范围
const cnum: array[0..9] of string = ('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
cunit: array[0..14] of string = ('万', '千', '百', '拾', '亿','千', '百', '拾', '万', '千', '百', '拾', '元', '角', '分');
var
i: Integer;
snum, stemp: string;
begin
result := '';
snum := format('%15d', [round(n * 100)]);
for i := 0 to 14 do
begin
stemp := copy(snum, i + 1, 1);
if stemp = ' ' then continue
else result := result + cnum[strtoint(stemp)] + cunit[i];
end;
//去掉多余的零
Result := StringReplace(Result, '零元', '元', [rfReplaceAll]);
Result := StringReplace(Result, '零拾', '零', [rfReplaceAll]);
Result := StringReplace(Result, '零百', '零', [rfReplaceAll]);
Result := StringReplace(Result, '零千', '零', [rfReplaceAll]);
Result := StringReplace(Result, '零万', '万', [rfReplaceAll]);
Result := StringReplace(Result, '零亿', '亿', [rfReplaceAll]);
Result := StringReplace(Result, '亿万', '亿', [rfReplaceAll]);
Result := StringReplace(Result, '零零零', '零', [rfReplaceAll]);
Result := StringReplace(Result, '零零', '零', [rfReplaceAll]);
Result := StringReplace(Result, '零万', '万', [rfReplaceAll]);
Result := StringReplace(Result, '零亿', '亿', [rfReplaceAll]);
Result := StringReplace(Result, '亿万', '亿', [rfReplaceAll]);
Result := StringReplace(Result, '零元', '元', [rfReplaceAll]);
if pos('零分', result) = 0 then Result := StringReplace(Result, '零角', '零', [rfReplaceAll])
else Result := StringReplace(Result, '零角', '整', [rfReplaceAll]);
Result := StringReplace(Result, '零分', '', [rfReplaceAll]);
end;