Einzelnen Beitrag anzeigen

Benutzerbild von Olli73
Olli73

Registriert seit: 25. Apr 2008
Ort: Neunkirchen
667 Beiträge
 
#21

Re: Rundungsproblem

  Alt 14. Aug 2009, 14:58
Zitat von khh:
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
  Mit Zitat antworten Zitat