Re: [Python-Dev] Adventures with Decimal

2005-05-22 Thread Greg Ewing
Raymond Hettinger wrote: > IMO, user input (or > the full numeric strings in a text data file) is sacred and presumably > done for a reason -- the explicitly requested digits should not be > throw-away without good reason. I still don't understand what's so special about the input phase that it s

Re: [Python-Dev] Decimal FAQ

2005-05-22 Thread Tony Meyer
> Q. I'm writing a fixed-point application to two decimal places. > Some inputs have many places and needed to be rounded. Others > are not supposed to have excess digits and need to be validated. > What methods should I use? > > A. The quantize() method rounds to a fixed number of decimal > pl

[Python-Dev] Decimal FAQ

2005-05-22 Thread Raymond Hettinger
Some of the private email I've received indicates a need for a decimal FAQ that would shorten the module's learning curve. A discussion draft follows. Raymond --- Q. It is cumbersome to type decimal.Decimal('1234.5'). Is there a way to mi

[Python-Dev] Adventures with Decimal

2005-05-22 Thread Mike Cowlishaw
Several people have pointed me at this interesting thread, and both Tim and Raymond have sent me summaries of their arguments. Thank you all! I see various things I have written have caused some confusion, for which I apologise. The 'right' answer might, in fact, depend somewhat on the programmin