All pastes #409985 Raw Edit

Miscellany

public text v1 · immutable
#409985 ·published 2007-03-26 01:04 UTC
rendered paste body
function Tform1.JurosComposto(ValorCalc, Perc, Parc: String): String;
var 
  A, B, Valor, Taxa: Real;
  I: Integer;
begin
  A := 0;
  B := 0;
  Result :=  EmptyStr;
  Valor := StrToFloat(ValorCalc);
  Taxa  := StrToFloat(Perc);   
  for I := 1 to StrToInt(Parc) do
  begin
    if A = 0 then
    begin
      A := Power(Calor * (1+(Taxa/100)),1);
      Result := FloatToStr(A);
    end else 
      if B = 0 then
      begin
        B := Power(A * (1+(Taxa/100)), 1);
        Result := Result + ',' + FloatToStr(B);
      end else begin
        B := Power(B * (1+(Taxa/100)), 1);
        Result := Result + ',' + FloatToStr(B);
      end;
  end;
end;