money class?

Michael Amrhein michael.amrhein at t-online.de
Thu Feb 7 13:10:19 EST 2002


"Mark McEahern" <mark at mceahern.com> schrieb im Newsbeitrag
news:mailman.1013051771.7427.python-list at python.org...
> Without starting an endless thread on how many floating point angels can
> dance on the head of a pin, I'd like to ask:
>
> Does anybody know of a nice Money class they'd be willing to share, point
> to?
>
> (I did a little bit of searching, but found nothing obvious in the 5-10
> minutes I spent.)
>
> I don't think it'd be too hard to write one myself, but I figured I'd see
> what's out there first.  I don't need something that handles different
> currency.  US Dollars is good enough.  I suppose I'll be taken to task (or
> ignored) for not specifying exactly what I need or why I need it.  What
can
> I say?  I'm lazy.  ;-)  Does this suffice?
>
> It should "Do the right thing."
>
> Thanks,
>
> // mark
>
>
Hi Mark,
I've written a class named 'fixed' with portions adopted from
Tim Peter's FixedPoint.py, but a slightly different constructor
(no default precision; precision calculated from given value,
if no precision given) and some additional functions.
Find fixedpoint.py enclosed and use it if you like.
Cheers,
Michael

The news server seems to refuse any posting with attachments.
So, I'll send it to you via e-mail. Sorry.





More information about the Python-list mailing list