On 2019-10-30 11:58, 'Check_Mail' check_m...@satron.de 
[firebird-support] wrote:
> Hello,
> 
> I use Microsoft Access as frontend, firebird 3 superserver as backand.
> Now, there a many linked tables in access over firebird odbc, some of
> the colums are in double precision format.
> 
> Now, I don't know why, in a Report I calculate the VAT, in my case:
> 
> 279.578,50 * 0,19
> 
> If I calculate it wit a calculator, I get 53.119,915
> 
> The frontend calculates me 53.119,143 and in result, the final sum is
> wrong. 915 should 92, but 914 will be 91.

If your frontend calculator gives you 53.119,143 then you are probably 
having a propagated compound calculation error caused by the use of 
double precision (or possibly early rounding).

In any case, you shouldn't use double precision for monetary values. 
Double precision is imprecise by its nature. Use a NUMERIC or DECIMAL 
instead, and if you use dialect 1, switch to dialect 3, because in 
dialect 1NUMERIC/DECIMAL with a precision over 9 are effectively double 
precision).

Mark
  • [firebird-support... 'Check_Mail' check_m...@satron.de [firebird-support]
    • Re: [firebir... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
    • Re: [firebir... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
    • [firebird-su... emou...@yahoo.fr [firebird-support]

Reply via email to