On Apr 23, 9:23 am, Phlip wrote:
> When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
> a Decimal() object, I must convert it to a string.
Why must you? What unwanted effect do you observe when you don't
convert it?
> the search for an alternate CSV module, without
> this bug
On Apr 22, 6:15 pm, Jerry Hill wrote:
> 10,10.0,10.00,"10"
>
> That's an int, a float, a Decimal and a string, all of which appear to
> be formatted as I would expect.
When you point your finger 'cause your plan fell thru
you got three more fingers, pointing back at you! --Dire Straights
--
htt
On Apr 22, 5:03 pm, MRAB wrote:
> It might be a stupid question, but have you tried passing in the
> Decimal() object itself?
Yep. Nope. Might as well (we ain't working today).
But sorry, as usual, for my tone, and thanks all for playing!
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 22, 2010 at 8:03 PM, MRAB wrote:
> It might be a stupid question, but have you tried passing in the
> Decimal() object itself?
MRAB's suggestion works for me in python 3.1.2:
import csv, io
from decimal import Decimal
d = Decimal("10.00")
o = io.StringIO()
w = csv.writer(o, quoting=
Phlip wrote:
Pythonistas:
This is not a question so much as registering a complaint.
When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
a Decimal() object, I must convert it to a string. _Not_ a float,
because that might cause the rounding errors that Decimal() seeks to
avoid
On 4/22/10 6:23 PM, Phlip wrote:
Pythonistas:
This is not a question so much as registering a complaint.
When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
a Decimal() object, I must convert it to a string. _Not_ a float,
because that might cause the rounding errors that Deci
Pythonistas:
This is not a question so much as registering a complaint.
When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
a Decimal() object, I must convert it to a string. _Not_ a float,
because that might cause the rounding errors that Decimal() seeks to
avoid. (We use Decim