Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi float in int umwandeln (https://www.delphipraxis.net/67347-float-int-umwandeln.html)

mkinzler 13. Apr 2006 12:18

Re: float in int umwandeln
 
Frac liefet ja den Nachkommateil als Real ohen den Ganzzahlanteil zurück, also aus 10,10 wird 0,10.
Das was du benötigst wäre
Delphi-Quellcode:
Nk := Trunc(Betrag*100-Trunc(Betrag)*100);
oder
Delphi-Quellcode:
nk := Trunc( Frac( Betrag)*100);

ksh 13. Apr 2006 12:33

Re: float in int umwandeln
 
super! vielen dank! das hat mir noch gefehlt - jetzt kann ich beide Zahlen bequem als Integer übergeben!

:thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:37 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz