[Gambas-user] Financial program

nando nando_f at ...951...
Tue Dec 15 01:07:01 CET 2009


My contribution to this conversation is..
Always INT or LONG for money.
Keep a global variable to divide by (for example 2 decimal places) 100
when printing/displaying things to humans...
-OR- to take the string and insert a period for cents (North America)
Make a really nice SUB to return a formatted string is good.
It is the utmost importance not to use FLOAT from the beginning
because calculations will be wrong after a while and it will not balance.
You will have headaches!!!

-Fernando


---------- Original Message -----------
From: "Ron_1st" <ronstk at ...239...>
To: gambas-user at lists.sourceforge.net
Sent: Tue, 15 Dec 2009 00:38:35 +0100
Subject: Re: [Gambas-user] Financial program

> On Tuesday 15 December 2009, Benoît Minisini wrote:
> > Again we are talking about currencies. What's the matter with telephony 
> > seconds? If you want to say that you have to store 1/1000th of cents, ro more, 
> > just choose a more precise format. With a Long datatype and using 1/1000000th 
> > of currency unit (!), you can store up to 4,6 x 10^12 units. That should be 
> > enough.
> >
> 
> Thanks for the calculation. I hope never have to pay that amount :) :)
> 
> Best regards,
> 
> Ron_1st
> 
> --
> 
> 111.111111 x 111.111111 = 12345.678987654321
> 
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------




More information about the User mailing list