[Gambas-user] About financial program in Gambas
Jean-Yves F. Barbier
12ukwn at ...626...
Wed Dec 16 10:23:35 CET 2009
Ricardo Díaz Martín a écrit :
> Hi to all,
>
> I'm use gambas to write ERP applications. At the first, I got the same
> problem but I decided to use long integer to save currency values. First
> rigth two digits are always showed to users as decimal values.
>
> I'm rewrited all my apps from windows to gambas and they are working now
> with no problems in customers servers.
>
> I allways use a function to show values in controls in app's forms that
> convert database fields values showed in textboxes whose name started int
> dbcur (p.e. dbcurVAT) to value div 100 and works with no problems. I use
> allways the same function to write forms data to database and make the
> reverse proccess.
Hooo, thanks for the ad.
> Its simple and works
Sounds exactly like the commercial about women thin down cream we've
got on tv for months (it works!) (sorry, I couldn't resist:)
So you're truncating everything to 2 decimals, but as I said VAT (and as
a matter of fact almost all french taxes) is *legally* up to 4 decimals;
actually only 2 of them are used, but nothing's saying that tomorrow
is won't be 3 or 4 really used (especially on those times where our
gov morons (pleonasm) are desesperatly looking for money.)
BTW, how do you truncate 19.99657? Down to 19.99 or up to 20.00?
In my family's company a cent error is worth €100,000 fine...
Other PB: most of results could be predictable (as of Nb of decimals),
but some can't (ie: 92.95x1.196=111.1682 OR 145x1.196=173.42),
maths says decimals should be dN1+dN2=5 but in these cases we only have
4 and 2 because of non-significant right zeroes, so you can't obviously
truncate by adding the comma counting 5 from the right.
One of the most used manner to get a selling price is to use a coefficient
which has many decimals (usually a real), how do you determine where to
put the comma in the resultant number??
I see the possibilities, but AFAIK this is a full processor to write
based on a complex numbers model, not to mention error possibilities
have a tremendous cataclysmic potential in a matter where tax
administration will be more than happy to chop your head and piss
on your brain (yeah, they're like that here: when they come it is
not to search, it is to find; no matter if has real justification or not.)
But may be I'm totally mistaking: I always have had PBs with simple
things.
JY
--
God is real, unless declared integer.
More information about the User
mailing list