Autor Beitrag
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 03.09.05 15:47 
Hi,

Datenbank : Firebird 1.5

Ich brauche einen Geldbetrag auf Cent genau. Bei dem Betrag handelt es sich um den Rückgabewert einer stored Procedure. Wie runde ich den jetzt ? ROUND scheint es nicht zu geben. Auf Anhieb finde ich nichts, was damit was zu tun haben könnte.

_________________
Gruß
Hansa
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: So 04.09.05 20:07 
Gibts sowas wie Trunc bei FB? Falls ja, kannst du ja die klassische Methode verwenden. Erklären muss ich dir die wohl nicht.
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 04.09.05 21:45 
Was für eine klassische Methode ? :shock: Den Bruchteil einer Zahl abzuschneiden nützt ja wohl auch nichts. Bei 1.97 darf doch nicht 1 rauskommen, sondern 2 !!

_________________
Gruß
Hansa
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 05.09.05 08:39 
1. Addiere 0,005.
2. Mit 100 multiplizieren.
3. Abschneiden.
4. Durch 100 dividieren.

Sonderfall negative Zahlen beachten!
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 13.09.05 13:00 
Ich würde sagen, so ists etwas eleganter :

select cast(123.456789 as decimal(15,2)) from tablex

toll, was ? :P

_________________
Gruß
Hansa
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 13.09.05 13:08 
Sieht auf jeden Fall einfacher aus. :wink: