Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transactions: fix paid fees still opened #1404

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

zannkukai
Copy link
Contributor

@zannkukai zannkukai commented Nov 5, 2020

The bit representation of real number
(https://en.wikipedia.org/wiki/IEEE_754) cause problem with arithmetic
operation on them (10-9.54 = 0.460000000000085). This commit fixes this
problem by multiplying transaction amount by 100 and cast them into
integer when arithmetic operations are done.

Closes #1373

Co-Authored-by: Renaud Michotte [email protected]

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?

@zannkukai zannkukai added the bug Breaks something but is not blocking label Nov 5, 2020
@zannkukai zannkukai added this to the v0.14.0 milestone Nov 5, 2020
@zannkukai zannkukai self-assigned this Nov 5, 2020
@zannkukai zannkukai force-pushed the zan-#1833-fix-transaction-pay-all branch from 4db10f2 to 0958df2 Compare November 5, 2020 18:28
The bit representation of real number
(https://en.wikipedia.org/wiki/IEEE_754) cause problem with arithmetic
operation on them (10-9.54 = 0.460000000000085). This commit fixes this
problem by multiplying transaction amount by 100 and cast them into
integer when arithmetic operations are done.

Closes rero#1373

Co-Authored-by: Renaud Michotte <[email protected]>
@zannkukai zannkukai force-pushed the zan-#1833-fix-transaction-pay-all branch from 0958df2 to be9392a Compare November 6, 2020 08:19
@zannkukai zannkukai requested review from BadrAly and lauren-d November 6, 2020 08:55
@zannkukai zannkukai marked this pull request as ready for review November 6, 2020 09:10
@iGormilhit iGormilhit added the f: circulation Concerns the circulation interface or backend label Nov 9, 2020
Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message approved.

@zannkukai zannkukai merged commit cf9f39e into rero:dev Nov 9, 2020
@zannkukai zannkukai deleted the zan-#1833-fix-transaction-pay-all branch November 9, 2020 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In the pro patron account, some paid fees still appear.
4 participants