Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'amounts': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'lawrence': 0.09; 'message- id:@stoneleaf.us': 0.09; 'parsed': 0.09; 'subject:number': 0.09; '~ethan~': 0.09; 'before.': 0.16; 'filename:fname piece:signature': 0.16; 'negative,': 0.16; 'normally.': 0.16; 'positive,': 0.16; 'subject:CSV': 0.16; 'wrote:': 0.18; 'appears': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; "skip:' 10": 0.31; 'workaround': 0.31; 'probably': 0.32; 'regular': 0.32; 'transaction': 0.35; 'easily': 0.37; 'easiest': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'most': 0.60; 'balance': 0.61; 'received:173': 0.61; 'frank': 0.68; 'bug!': 0.84; 'transactions': 0.91 Date: Sun, 01 Feb 2015 00:22:21 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: CSV and number formats References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4pN1BLob8pO5I7aTdMWEFQdRU5cxKrrFH" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 54 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422778947 news.xs4all.nl 2852 [2001:888:2000:d::a6]:40225 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84991 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4pN1BLob8pO5I7aTdMWEFQdRU5cxKrrFH Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 '+0000002= 4.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~ --4pN1BLob8pO5I7aTdMWEFQdRU5cxKrrFH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJUzeJAAAoJENZ7D1rrH75NztQQAI6t59OELs/tTQxKyAyYTA+p u7wGnU22zS0V+lPOM1oq20+jhe/akJs9WYRLyEmn2L3cU6yOg+BXGUyD6URZn//A 8p3HJvw237FQP+ltqBUJAdTK8XRmRtEKvHrciA8lzQXxn/vQBU/QAmVzoSKFgb2v oCrqtOXbWx8iEqwFzIsiBlAFujXV+PkO7NOBNBy761mBLG0XmaikxqItaHIdEZdd JuPHbSEIUiy6wcNXh/QqkYVRo/b2g1P1hjZ1czfg+jBql03scm7DFoS8bAcKnXQr NJCqIzfiJI/6PGnCfs42hPT5yUsHAd0GRGtDKNziYmOeiVUWGiZskbEohfZp2L3d 0a1eCZSV7H22eFLTzjdSR/z1sHMJCUihj0i1OOQaJjclGxK23Aeidomnh774+yt6 8YrsW5M1kIZ1WrO1vUrwQQTnWpnu7wkWp9UOc5dZ2iRSH/W+H9X4YTb/69mfHzYp gypNDjhWitKkj1EJFejXw1MnxlOiMO5IOY740BNiQ5GYE3v04ZCcDyjASCeYK8HR CtHSlJkDh/kUgFIjzPrsd+OTKVW4iu8A0TmePsRApB0yRMhDkIq/mn0XsOmOdW+/ 5G9BEKQPxjXanAaJRYAtW3Yoc1X6NEwEeA9qsHDAddQrvOII3mRWBJqTFCfODoOh XQn0Kw3yduV7Q3ImDdz6 =lqKQ -----END PGP SIGNATURE----- --4pN1BLob8pO5I7aTdMWEFQdRU5cxKrrFH--