Merge lp:~therp-nl/banking-addons/ba61-lp1098699-fix_clieop_rounding_issue into lp:banking-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 152
Proposed branch: lp:~therp-nl/banking-addons/ba61-lp1098699-fix_clieop_rounding_issue
Merge into: lp:banking-addons/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
account_banking_nl_clieop/wizard/clieop.py (+1/-1)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ba61-lp1098699-fix_clieop_rounding_issue
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Alexandre Fayolle - camptocamp Approve
Holger Brunn (Therp) Approve
Review via email: mp+142978@code.launchpad.net

Description of the change

This branch fixes a rounding issue in the "clieop" export, which contains the amount encoded without the comma separator between euros and cents, i.e. as an integer. Amounts like €1,05 come out as €1,04 due to the internal Python representation of 100 * 1,05 as 104,99999999999. Using round() will thus give better results than int().

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

looks good to me

review: Approve
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM, merged

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_banking_nl_clieop/wizard/clieop.py'
--- account_banking_nl_clieop/wizard/clieop.py 2011-07-21 11:30:59 +0000
+++ account_banking_nl_clieop/wizard/clieop.py 2013-01-11 19:52:21 +0000
@@ -278,7 +278,7 @@
278 self.transaction.transactiontype = type_278 self.transaction.transactiontype = type_
279 self.transaction.accountno_beneficiary = accountno_beneficiary279 self.transaction.accountno_beneficiary = accountno_beneficiary
280 self.transaction.accountno_payer = accountno_payer280 self.transaction.accountno_payer = accountno_payer
281 self.transaction.amount = int(amount * 100)281 self.transaction.amount = round(amount * 100)
282 if reference:282 if reference:
283 self.paymentreference.paymentreference = reference283 self.paymentreference.paymentreference = reference
284 # Allow long message lines to redistribute over multiple message284 # Allow long message lines to redistribute over multiple message

Subscribers

People subscribed via source and target branches