It certainly seems that precision is important when using 5 decimal place
exchange rates on 4 decimal place currency data. I knocked up a quick
program to illustrate:

CREATE CURSOR testrate (money1 Y, xrate B(5), money2 Y, id I AUTOINC)
INDEX ON id TAG id COLLATE "Machine"
SET ORDER TO 0
INSERT INTO testrate (money1, xrate) VALUES ($1000, 1.70092)
INSERT INTO testrate (money1, xrate) VALUES ($1000, 1.70092)
*!* This should give an incorrect result (1700.90)
UPDATE testrate SET money2 = money1*xrate WHERE id = 1
*!* This should give the correct answer (1700.92)
UPDATE testrate SET money2 = NTOM(MTON(money1)*xrate) WHERE id = 2
BROWSE NORMAL IN SCREEN

Laurie


On 18 June 2014 23:18, Richard Kaye <[email protected]> wrote:

> >From small errors, big things can oft be found...
>
> <http://en.wikipedia.org/wiki/The_Cuckoo%27s_Egg>
>
> --
>
> rk
> -----Original Message-----
> From: ProfoxTech [mailto:[email protected]] On Behalf Of
> [email protected]
> Sent: Wednesday, June 18, 2014 5:26 PM
> To: [email protected]
> Subject: RE: VAT Rates
>
> On 2014-06-18 14:01, Richard Kaye wrote:
> > A penny on a single $100 transaction is usually not any cause for
> > concern. A $1000 cumulative error on hundreds or thousands of
> > transactions may not be a real worl  d issue but it will probably
> > raise a flag that requires investigation and then you're headed down
> > the rabbit hole. And if that flag was raised by your local tax/VAT
> > authority the fun will be even greater...
>
>
> Makes me think of Superman 3 with Richard Pryor as the computer programmer
> who siphons off the rounding errors.  lol
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CAMvTR9c2wMYK58BbO4=wik6g6uxkt4jselhj_aedsrg6frl...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to