Proposal: Decimal literals in Python.

Terry Reedy tjreedy at udel.edu
Sat Oct 27 05:41:32 CEST 2007


"Shane Geiger" <sgeiger at ncee.net> wrote in message 
news:4722398D.7070903 at ncee.net...


a buggy hack (copying your top post style)

>>> D(123456789.123456789)
Decimal("123456789.123")

Or what there an unwritten :-)?

| D = lambda x: decimal.Decimal(str(x))
|
| >> D(3.2)
| Decimal("3.2")






More information about the Python-list mailing list