Why not FP for Money?

Paul Rubin http
Fri Sep 24 03:57:10 EDT 2004


aleaxit at yahoo.com (Alex Martelli) writes:
> > A native Money type, either with the $ signal ($35.72) or the suffix
> > (35.72D) would not present the same issues, because the literal would
> 
> Right, but in practice I find that:
> 
> def d(x): return decimal.Decimal(str(x))
> 
> appears to work pretty well, judging from early experimentation.

Hmm.  What does d(35.72) give you?  The same thing as d('35.72')?
Either answer is arguably wrong.



More information about the Python-list mailing list