Einzelnen Beitrag anzeigen

Lemmy

Registriert seit: 8. Jun 2002
Ort: Berglen
2.366 Beiträge
 
Delphi 10.3 Rio
 
#9

AW: Firebird und Numeric fields

  Alt 21. Jul 2017, 22:41
http://www.firebirdfaq.org/faq79/

Zitat:
Here's an example: if you multiply 9.12 with 8.11 (both numeric(18,2)) you would get 73.9632. If Firebird would store that into numeric(18,2) datatype, we would lose 0.0032. Doesn't look much, but when you have complex calculations, you can easily loose thousands (dollars or euros). Therefore, the result is stored in numeric(18,4).

ähm. ja.. Logisch. Technisch bedingt aber eine Multiplikation von Numeric(18,4) kein Ergebnis mit mehr Nachkommastellen. Das kann max. eine fachliche Anforderung sein, davon hast Du leider nix geschrieben. Und ja, es gibt Anwendungsfälle, bei denen man zwingend die Zwischenergebnisse auf 2 Nachkommastellen rundet.
  Mit Zitat antworten Zitat