Autor Beitrag
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 16.06.03 08:02 
Guden,

kann mir ma einer sagen,
Wie ich mithilfe von Format den Int64 zu einem str. bekomme???

also so gehts ma nich
ausblenden Quelltext
1:
2:
n:Int64;
Format('%5.3f',[n]);


einer einen anderen Vorschlag??
Ich muss aber runden können

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 16.06.03 08:15 
Ich hab nicht genau kapiert, was Du hier machen willst, ich habe auch mal in der Hilfe nach Format gesucht (weil ich selten mit Format arbeite), aber das habe ich dazu in der Hilfe gefunden:
Delphi-Hilfe hat folgendes geschrieben:
f Fest. Das Argument muss ein Gleitkommawert sein. Der Wert wird in einen String der folgenden Form umgewandelt: "-ddd.ddd...". Wenn es sich um eine negative Zahl handelt, beginnt der String mit einem Minuszeichen.

Denn mir kam, der Punkt schon komisch vor. Int64 ist ein Integer, also eine Ganzzahl, was willst Du denn da runden?

Wenn Du Fließkommazahlen runden willst, schau dir mal floattostrf an.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 16.06.03 08:24 
ausblenden Delphi-Quelltext
1:
s := Format("%d", [n]);					
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 16.06.03 08:30 
danke luckie ich probiers ma aus !

@ugrohne

1. floatToStr wandelt flieskommazahlen in String um richtig , aber ich kann keine genauigkeitsangabe machen.

2. In der OH habe ich auch schon nachgesehen, nur kein passendes argunemt gefunden bzw. war mir nicht sicher.

In64 ist zwar ein int. , dennoch handelt es sich um eine flieskommazahl, als wert den ich bekomme.
Int64 deklaration brauche ich, um den festplattenspeicher zu ermitteln dießer will ich natürlich runden, das da nicht jedes byte steht.

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 16.06.03 08:40 
foxy hat folgendes geschrieben:
1. floatToStr wandelt flieskommazahlen in String um richtig , aber ich kann keine genauigkeitsangabe machen.
Bitte nochmal lesen: Ich habe gesagt floattostrf und damit kannst Du meines Wissens auch Genauigkeitsangaben machen.

Gruß
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 16.06.03 08:42 
narf ... okö sry habs überlesen :roll:

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 16.06.03 08:44 
foxy hat folgendes geschrieben:
narf ... okö sry habs überlesen :roll:
Wenn Du ganz lieb bitte sagst, dann verzeih ich Dir vll. :twisted: Nene, schon in Ordnung, passiert mir auch oft.
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 16.06.03 09:01 
hehe zu gütch ;)

nee ich habs nu luckie hatte recht ging mit formatanweisung d

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)