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

Einzelnen Beitrag anzeigen

Tyrael Y.

Registriert seit: 28. Jul 2003
Ort: Stuttgart
1.093 Beiträge
 
Delphi 2007 Professional
 
#12

Re: Prüfen ob (Ganz-)Zahl

  Alt 19. Dez 2003, 14:51
Zitat:
Hi, du könntest das vll so machen:
Source:

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
oh Mann
gut das ich sowas in unserem Code nicht sehe
mir stehen die Haare zu Berge

try except ist zur Feherbehandlung und nicht um einen Wert richtig zu stellen.
so ein Konstrukt funktioniert, sollte aber nie benutzt werden

Gruß
Levent Yildirim
Erzeugung von Icons aus Bildern:IconLev
  Mit Zitat antworten Zitat