CSV and number formats

Ethan Furman ethan at stoneleaf.us
Sun Feb 1 03:22:21 EST 2015


On 01/31/2015 11:23 PM, Mark Lawrence wrote:
> On 01/02/2015 06:45, Frank Millman wrote:
>>
>>
>> Most transaction amounts are in the format '-00000031.23' or '+00000024.58'
>>
>> This can easily be parsed using decimal.Decimal().
>>
>> If the opening balance is positive, it appears as '+00000021.45'
>>
>> If it is negative, it appears as '+00000-21.45'

1) I have never seen that format before.

2) Regular transactions (non-opening balance) appear normally.

3) That's a bug!

4) Easiest workaround is probably to lstrip('+0').

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20150201/6bc4415e/attachment.sig>


More information about the Python-list mailing list