Autor Beitrag
stathis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Fr 02.09.05 18:42 
Hallo!!!

Ich brauche wieder Ihre hilfe.

ich benutze die funktion roundto(x,-2) um eine realo zahl x zu runden, aber
ich möchte bei die nachkommastelle in Real Zahl die 0 bleiben. Also nicht 1,3 sondern 1,30 wie geht es;

damit bei ausdrucken schöner aussieht:

1,30
2,40
4,45

und nicht
1,3
2,4
4,45


ich danke Ihnen


Stathis


Moderiert von user profile iconChristian S.: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am Fr 02.09.2005 um 19:44
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: Fr 02.09.05 18:50 
ausblenden Delphi-Quelltext
1:
floattostrf(zahl,fffixed,4,2);					


verwende das bei der Ausgabe der Zahlen :wink:

_________________
GEIZ IST GEIL! - Ihr Sozialamt
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Fr 02.09.05 21:42 
oder auch
ausblenden Delphi-Quelltext
1:
FormatFloat ('0.0,00',f);					

Neu! Formatiert sogar mit Tausender-Trennzeichen.
oder auch
ausblenden Delphi-Quelltext
1:
Format ('%6.2f',[f])					

na, usw.
und and den @starsurfer geht der Dank, das ich mal wieder was gelernt habe, denn die Funktion kannte ich noch nicht.,
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 02.09.05 22:51 
user profile iconalzaimar hat folgendes geschrieben:
und and den @starsurfer geht der Dank, das ich mal wieder was gelernt habe, denn die Funktion kannte ich noch nicht.,

:arrow: FloatToStrF ist eine Wrapper-Funktion für die Funktion FloatToText.