如题

解决方案 »

  1.   

    1、money太少
    2、问题没有描述清楚
      

  2.   

    ///小写金额转化为大写金额function Convert(jiner: string): string;
    const
      Daxie: array[0..9] of string =
      ('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
      DanWei: array[0..10] of string =
      ('亿', '仟', '佰', '拾', '万', '仟', '佰', '拾', '元', '角', '分');
    var
      TempNum: string;
      TempDaxie: array[0..10] of string;
      StrLen: Integer;
      I: integer;
      TempFh: string; //符号正负
    begin
      TempFh := '';
      if Copy(jiner, 1, 1) = '-' then
      begin
        TempFh := '负:';
        jiner := Copy(jiner, 2, 20);
      end;
      TempNum := '-1';
      StrLen := Length(jiner);
      for I := 0 to 10 do begin
        if I > StrLen - 1 then Tempnum := '0' else TempNum := Copy(jiner, Strlen - I, 1);
        TempDaXie[10 - I] := Daxie[StrToInt(TempNum)];
      end;
      Result := '';
      if TempDaxie[0] <> '零' then Result := TempDaxie[0] + DanWei[0];
      if TempDaxie[1] <> '零' then Result := Result + TempDaxie[1] + DanWei[1]
      else if Length(Result) > 0 then Result := Result + '零';
      if TempDaxie[2] <> '零' then Result := Result + TempDaxie[2] + DanWei[2]
      else if (Length(Result) > 0) and ((Copy(Result, Length(Result) - 1, 2) <> '零')) then Result := Result + '零';
      if TempDaxie[3] <> '零' then Result := Result + TempDaxie[3] + DanWei[3]
      else if (Length(Result) > 0) and ((Copy(Result, Length(Result) - 1, 2) <> '零')) then Result := Result + '零';
      if TempDaxie[4] <> '零' then Result := Result + TempDaxie[4] + DanWei[4]
      else if (Length(Result) > 0) then begin
        if (Copy(Result, Length(Result) - 1, 2) <> '零') then Result := Result + '万'
        else Result := copy(Result, 1, Length(Result) - 2) + '万';
      end;
      if TempDaxie[4] <> '零' then begin
        if TempDaxie[5] <> '零' then Result := Result + TempDaxie[5] + DanWei[5]
        else if Length(Result) > 0 then Result := Result + '零';
      end else begin
        if TempDaxie[5] <> '零' then begin
          if Length(Result) > 0 then Result := Result + '零' + TempDaxie[5] + DanWei[5]
          else Result := Result + TempDaxie[5] + DanWei[5];
        end else if Length(Result) > 0 then Result := Result + '零';
      end;
      if TempDaxie[6] <> '零' then Result := Result + TempDaxie[6] + DanWei[6]
      else if (Length(Result) > 0) and (Copy(Result, Length(Result) - 1, 2) <> '零') then Result := Result + '零';
      if TempDaxie[7] <> '零' then Result := Result + TempDaxie[7] + DanWei[7]
      else if (Length(Result) > 0) and (Copy(Result, Length(Result) - 1, 2) <> '零') then Result := Result + '零';
      if TempDaxie[8] <> '零' then Result := Result + TempDaxie[8] + DanWei[8]
      else if (Length(Result) > 0) then begin
        if (Copy(Result, Length(Result) - 1, 2) <> '零') then Result := Result + '元'
        else Result := copy(Result, 1, Length(Result) - 2) + '元';
      end;
      if TempDaxie[8] <> '零' then begin
        if TempDaxie[9] <> '零' then Result := Result + TempDaxie[9] + DanWei[9]
        else if Length(Result) > 0 then Result := Result + '零';
      end else begin
        if TempDaxie[9] <> '零' then Result := Result + '零' + TempDaxie[9] + DanWei[9]
        else if Length(Result) > 0 then Result := Result + '零';
      end;
      if TempDaxie[10] <> '零' then Result := Result + TempDaxie[10] + DanWei[10]
      else if (Length(Result) > 0) then begin
        if (Copy(Result, Length(Result) - 1, 2) <> '零') then Result := Result + '整'
        else Result := copy(Result, 1, Length(Result) - 2) + '整';
      end;
      Result := TempFh + Result;
    end;
      

  3.   

    自己改字符加几个and就可以了