Allocated % in the allocation of emissions page shows 100% allocated when not exactly 100% #465
Labels
Bug
Something isn't working
Deletion Candidate
Ticket that could potentially be removed pending consensus
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
Steps to reproduce the behaviour:
The text was updated successfully, but these errors were encountered: