Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Rundungsproblem (https://www.delphipraxis.net/138505-rundungsproblem.html)

Olli73 14. Aug 2009 14:58

Re: Rundungsproblem
 
Zitat:

Zitat von khh
Zitat:

Zitat von mkinzler
Einfach nach dem Trunc durch 1000 teilen

so hatte ich mir das auch gedacht,leider funktioniert das nicht, weiss der Teufel warum.
wenn ich _nicht_ teile steht im currency-feld 8500000, also das tausendfache was ich brauche
teile ich durch 10 steht im currency-feld 850000
teile ich durch 100 steht im currency-feld 80000
teile ich durch 1000 steht im currency-feld 0

was läuft da schief?

Teile mal durch 1000.00
Bei Integer/Integer kommt in Firebird Integer raus (Nachkommastellen abgeschnitten).
Zur Veranschaulichung teste mal:
SQL-Code:
select 1, 3/4 from rdb$database
union all
select 2, 3/4.0 from rdb$database
union all
select 3, 3/4.00 from rdb$database
union all
select 4, 3.0/4 from rdb$database
union all
select 5, 3.00/4 from rdb$database
union all
select 6, 3.0/4.0 from rdb$database


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:06 Uhr.
Seite 3 von 3     123   

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