人民币大写

来源:互联网 发布:欧洲聊天软件 编辑:程序博客网 时间:2024/05/17 04:38
const Len:Integer = 10 ;
           cNum: WideString = '零壹贰叁肆伍陆柒捌玖';
function NumToChar(const n: Double): string;
var
  i : Integer;
  sNum,sTemp : WideString;
begin
  result :='';
  sNum := format('%'+inttostr(Len)+'d',[round(n * 100)]);
  for i := 0 to Len-1 do
  begin
    stemp := copy(snum,i+1,1);
    if stemp=' ' then
      continue
    else
      Result := Result + cNum[strtoint(stemp)+1];
  end;
end;