Autor Beitrag
neo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179



BeitragVerfasst: Di 17.06.03 20:58 
Hallo!

Wie kann ich eine Single bzw. Double Zahl runden?

Danke!
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Di 17.06.03 20:59 
ausblenden Delphi-Quelltext
1:
round(y)					


Wenn du ne kaufmännische rundung:mrgreen: auf bestimmte stellenanzahl suchst dann such mal hier im Forum nach kaufmännisch bzw Stellen und Runden

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 18.06.03 10:48 
În vielen fällen reicht abschneiden auch aus (nur der vollständigkeit halber):

trunc(2.12112) = 2

_________________
mfg.
mâximôv
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mi 18.06.03 11:55 
hallo neo!

wenn du die zahl auf cent genau brauchst, dann addier einfach vor round 0,005. somit erreichst du, dass bei 0,005 schon auf 0,01 aufgerundet wird.
ich hab mit dem datentyp single nicht die besten erfahrungen gemacht, er liefert hin und wieder eigenartige ergebnisse.
seitdem ich double verwende, stimmen meine zahlen wieder. fast. ;)

mfg, stefan