[Gambas-user] About financial program in Gambas
Ricardo Díaz Martín
oceanosoftlapalma at ...626...
Wed Dec 16 08:40:22 CET 2009
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.
Its simple and works
2009/12/15 Benoît Minisini <gambas at ...1...>
> Wow, what a big talk...
>
> I just want to explain a few points.
>
> 1) I didn't say that I don't want to implement a currency or fixed decimal
> datatype in Gambas 3. I just can't. The maximum number of native datatypes
> has
> been reached the way the datatype system works. So it needs a good bit of
> redesign in the interpreter. Think to the datatype conversion functions,
> that
> must be able to convert any datatype to any other. Its size is almost
> proportional to the square of the number of datatypes. All arithmetic
> functions must deal with all datatypes. And so on... I wanted to keep the
> interpreter small, so adding these features was never a priority.
>
> 2) In some languages, the datatype has a meaning in the way the data in
> stored
> in memory *and* in the way the data must be display on the screen. But not
> in
> Gambas. This is the reason I don't like declaration of fixed floating point
> values, that are just integers with a special multiplication and division.
>
> 3) Why nobody starts writing a Decimal class whose objects are fixed
> floating
> point values, with a lot of financial methods? That beast can be written in
> Gambas first, and then converted to a C component easily, as no library is
> needed to perform all the computation. But maybe using a already existing
> financial library is a better idea then.
>
> 4) Floating point values are computed in base 2. And, in base 2, 1/10 is
> like
> 1/3 in base 10. You cannot represent it with a finite precision. So:
>
> 1.4 - 0.2 = 1.200000047684
>
> is perfectly valid with a Single datatype. You get the real value stored in
> memory.
>
> Regards,
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list