[moneydance] ProfitCalc extension build 3 and more
Srini
srini.listmail at gmail.com
Fri May 5 02:43:08 EDT 2006
Hi Sean
When I find time over the next few weeks I will try to iron it out based on
your suggestions ..
Thanks
Srini
On 5/4/06, Sean Reilly <sreilly at seanreilly.com> wrote:
>
>
> On May 1, 2006, at 9:07 PM, Edward Reid wrote:
>
> > At 10:54 05/01/06 -0600, Jeff Poole wrote:
> >> The formatting problem is due to the fact that computers store
> >> numbers in
> >> binary, and there is no exact representation for 0.568 in binary (at
> >> least, not in the 54 bits you get to represent it for a double
> >> precision
> >> floating point number).
> >
> > The problem is not with binary, but with using binary FLOATING POINT.
> > Floating point is inappropriate for storing monetary amounts (or any
> > numbers with exact decimal fractions), since 1/5 cannot be exactly
> > represented in binary floating point.
> >
> > The correct way of storing monetary amounts is to use an integer
> > (pick a
> > type that's large enough for the amounts in question) and to save
> > the scale
> > factor separately.
>
> In fact, this is how Moneydance records all amounts. It should be
> possible to do all the calculations in Moneydance without resorting
> to floating point, except for prices (which are secondary to the
> accuracy of all amounts).
>
> Srini, if you are sticking to using the integer/long amounts then I
> would recommend using the CurrencyType.format*(long value, char
> decimalPoint) methods to display the values.
>
> Thanks,
> Sean
>
>
>
>
> _______________________________________________
> moneydance-info mailing list
> moneydance-info at moneydance.com
> http://moneydance.com/mailman/listinfo/moneydance-info
>
>
>
More information about the moneydance-info
mailing list