Why not FP for Money?
Batista, Facundo
FBatista at uniFON.com.ar
Thu Sep 23 09:05:52 EDT 2004
[John Roth]
#- > Or a currency type, specifically.
#-
#- Well, this was discussed and rejected - see the discussion
#- on the decimal floating point PEP. I disagree with the
#- rejection. [Shrug.]
No, it wasn't rejected. Just postponed.
As I wrote in the PEP:
I wanted a Money data type, and after proposing a pre-PEP in
comp.lang.python, the community agreed to have a numeric data type
with the needed arithmetic behaviour, and then build Money over
it: all the considerations about quantity of digits after the
decimal point, rounding, etc., will be handled through Money. It
is not the purpose of this PEP to have a data type that can be
used as Money without further effort.
Maybe someday I'll put to work again in a Money or Currency data type (which
name do you prefer?), which, for example, keeps the decimal digits in 'n'
(2, 3, 5, configurable) rounding at each operation, and gets printed like
"$1,236.36", or "1236,36EU$" or something (depending on locale settings,
overradeable with a context), and etc, and etc.
. Facundo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040923/345919d2/attachment.html>
More information about the Python-list
mailing list