![]() |
FormatFloat Problem
Irgendwie scheint er bei mir den FormatFloat Befehl nicht zu "bemerken"? Ich wolllte, dass er mir alles vor dem Komma + 2 Nachkommastellen anzeigt.
Delphi-Quellcode:
temp := ValueArray[abc+2,0]/(Zeile+1);
FormatFloat('0.##',temp); ValueArray[abc+3,0] := temp; |
Re: FormatFloat Problem
.. ich kann mich jetzt täuschen, aber ist FormatFloat nicht eine Funktion?
Grüße Klaus |
Re: FormatFloat Problem
Du täuschst Dich nicht, Klaus. Also Rückgabewert auswerten.
|
Re: FormatFloat Problem
:wall: :wall:
Delphi-Quellcode:
nicht wahr..
ValueArray[abc+3,0] := StrToFloat(FormatFloat('0.##',ValueArray[abc+2,0]/(Zeile+1)));
|
Re: FormatFloat Problem
Prinzipiell ja, aber was machst Du da eigentlich? Wozu wird da hin- und wieder zurückkonvertiert :shock:?
|
Re: FormatFloat Problem
bevor Du, wie Detlef schon geschrieben hat, immer zwischen den Typen#
hin und her konvertierst kannst Du Dir mal die Routine (Funktion) roundTo anschauen. .. und noch etwas Kritik, normalerweise formatiert man einen Wert nur wenn man ihn anzeigen will und nicht einfach so mal zwichendurch - das bringt nur Rundungsfehler in die Berechnungen hinein. Grüße Klaus |
Re: FormatFloat Problem
Ok. Hab es jetzt erst bei der Ausgabe/Anzeige formatiert. Danke für den Hinweis
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:25 Uhr. |
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