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

Use integer cents in AMAP / Tombola #366

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BLEMENT33
Copy link
Contributor

Description

I change all the amounts in cents (integer) to avoid rounding issues.

@BLEMENT33 BLEMENT33 linked an issue Mar 15, 2024 that may be closed by this pull request
[ticket.pack_ticket.price / ticket.pack_ticket.pack_size for ticket in tickets]
)
))
Copy link
Contributor

Choose a reason for hiding this comment

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

The goal of this PR is to avoid imprecision errors. Maybe there is a way to avoid dividing values before converting to int

@guillaumetavernier
Copy link
Contributor

Nice one ! You will need to look into migration files to convert float euro database values to new int cent values

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.26%. Comparing base (f231edc) to head (f1a966a).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #366   +/-   ##
=======================================
  Coverage   78.26%   78.26%           
=======================================
  Files          76       76           
  Lines        5351     5351           
=======================================
  Hits         4188     4188           
  Misses       1163     1163           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@armanddidierjean armanddidierjean added bug Something isn't working amap tombola labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amap bug Something isn't working tombola
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use integer cents in AMAP / Tombola
3 participants