Proposal: Decimal literals in Python.

Terry Reedy tjreedy at udel.edu
Fri Oct 26 23:41:32 EDT 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