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

Allocated % in the allocation of emissions page shows 100% allocated when not exactly 100% #465

Closed
dleard opened this issue Dec 19, 2024 · 4 comments
Labels
Bug Something isn't working Deletion Candidate Ticket that could potentially be removed pending consensus

Comments

@dleard
Copy link

dleard commented Dec 19, 2024

Describe the Bug:

The % allocated for emissions to products shows 100% allocated when not exactly 100%. This blocks submission of the page & can be confusing to users because the error shown says not 100% have been allocated, but the page shows 100% for all emissions. This happens because we allow 4 decimal places for the emissions allocated, but the % rounds that up when displaying 99.9999% allocated, but still blocks because it's not exactly 100%.

Consider:

emissions to be allocated: 1000
product 1 allocated: 499.9999
product 2 allocated: 500.0000
Allocated percent will show: 100%
Page submission will be blocked & error message will say not 100% of emissions have been allocated.

Potential solution:
Always round the Allocated % down
Increase the precision of the Allocated % display (may need too many decimal places to be a valid solution)

Probability: 2

Impact: 3

Bug Matrix

Steps to reproduce the behaviour:

  1. Go to allocation of emissions page & allocate emissions with 1/10000th off of 100%
  2. See that allocated % shows 100 but the page submission is blocked
@dleard dleard added the Bug Something isn't working label Dec 19, 2024
@dleard
Copy link
Author

dleard commented Dec 19, 2024

A thought: is % even what we want to display here? Or would an unallocated total make more sense and be more accurate?

@dleard
Copy link
Author

dleard commented Jan 8, 2025

@acatchpole @patriciarussellCAS Duplicate of #468 ?

@dleard dleard added the Deletion Candidate Ticket that could potentially be removed pending consensus label Jan 8, 2025
@acatchpole
Copy link

yes. this issue is addressed in bcgov/cas-registration#2637

@rdromey
Copy link
Contributor

rdromey commented Jan 14, 2025

Confirmed addressed already

@rdromey rdromey closed this as completed Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Deletion Candidate Ticket that could potentially be removed pending consensus
Projects
None yet
Development

No branches or pull requests

3 participants