Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Format und mehr als 18 Nachkommastellen (https://www.delphipraxis.net/36614-format-und-mehr-als-18-nachkommastellen.html)

CalganX 22. Dez 2004 16:53


Format und mehr als 18 Nachkommastellen
 
Hi,
ich versuche gerade eine Float-Zahl auf mehr als 18 Nachkommastellen genau auszugeben. Dazu bediene ich mich der Funktion Format. Im aktuellen Fall sieht das dann so aus:
Delphi-Quellcode:
  lbOutput.Caption := szOutput + Format('%.18f', [pi]); // lbOutput ist ein Label, szOutput ein Resourcestring und pi ein Extended-Wert
Im Label steht zwar jetzt noch die richtige Zahl auf 18 Nachkommastellen genau, aber bei 19 sind es nur noch zwei. Extended sollte doch eigentlich noch mehr speichern, oder?

Chris

dde 22. Dez 2004 18:21

Re: Format und mehr als 18 Nachkommastellen
 
Delphi-Hile:

Zitat:

Typ : Extended
Bereich : 3.6 x 10^-4951 .. 1.1 x 10^4932
Signifaikante Stellen: 19-20
Größe in Byte : 10
lbOutput.CaptioN:=FloatToStr(pi); bzw.
lbOutput.CaptioN:=FloatToStrF(pi,fGeneral,18,1);

CalganX 22. Dez 2004 18:34

Re: Format und mehr als 18 Nachkommastellen
 
Hi,
:wall: Gut' Nacht, ich leg' mich wieder ins Bett. Das wird so nichts mehr. :cry:

Danke für den Hinweis,
Chris


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:12 Uhr.

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