Einzelnen Beitrag anzeigen

Benutzerbild von Coder
Coder

Registriert seit: 27. Feb 2004
Ort: Bochum
203 Beiträge
 
Delphi 3 Professional
 
#1

Umwandlung => Tage in "x Jahre, y Monate, und z Tage

  Alt 15. Jun 2005, 11:55
Wie geht die
Umwandlung
Tage => in => "x Jahre, y Monate, und z Tage?

also die Umwandlung in x Jahre und y Tage funktioniert so in etwa (obwohl da auch noch 1 Fehler drin scheint... => bei 365 Tagen )

Delphi-Quellcode:
function umwand(tage: Integer) : integer;
var astr: string;
a, c: real;
b ,d :integer;
begin
c:= (tage);
a := dix (tage , 365.25);
d := trunc(a* 365.25);
b := abs(trunc((tage -(d )))) mod 365;
c := trunc( tage ) ;
astr := floattoStr ( a ) + ' Jahre ' + floattoStr ( b ) + ' Tage'+ chr(13)+chr(10);
Form1.Memo1.Text := astr;
end;
habt Ihr eine Idee?


danke
  Mit Zitat antworten Zitat