convert user input to Decimal objects using eval()?
Julian Hernandez Gomez
jhernandez at pragma.com.co
Mon Mar 28 12:03:24 EST 2005
Hi !
This is maybe a silly question, but...
is there a "easy way" to make eval() convert all floating numbers to Decimal
objects and return a Decimal?
for example:
eval('1.00000001+0.1111111') --> convert each number to a Decimal object,
perform the sum and obtain a Decimal object as a result?
maybe a parser is needed, but eval() already do the job, but I need the
precision that Decimal offers for numerical applications.
Thanks in advance.
--
Julián
More information about the Python-list
mailing list