Thema: Delphi Prüfen ob (Ganz-)Zahl

Einzelnen Beitrag anzeigen

Benutzerbild von devnull
devnull

Registriert seit: 5. Okt 2003
362 Beiträge
 
Delphi 7 Personal
 
#11

Re: Prüfen ob (Ganz-)Zahl

  Alt 19. Dez 2003, 14:47
Hi, du könntest das vll so machen:
Delphi-Quellcode:
   if zahl1 <> round (zahl1) then // Zahl ist eine KommaZahl
   // zahl1 ist hier vom Typ real - Umwandlung davor mit try-except StrToFloat
Mit frac bekommste die Nachkommaziffern heraus...

devnull
-- Never change a running system --
  Mit Zitat antworten Zitat