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" <[email protected]> To: [email protected] 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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/gambas-user ------- End of Original Message ------- ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
