| Summary: | Incorrect return values when calculating the average expenditure of each Item | ||
|---|---|---|---|
| Product: | online shop management system | Reporter: | gkpcheung3-c |
| Component: | Sales System | Assignee: | gkpcheung3-c |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | gkpcheung3-c |
| Priority: | High | ||
| Version: | 1.0.0 | ||
| Hardware: | PC | ||
| OS: | Windows | ||
|
Description
gkpcheung3-c
2020-11-01 17:42:46 HKT
Step of the test case: 1. Sum up all the income of the product. 2. Calculate the average expenditure by total income divided by the total number of products. 3. Calculate the expected average expenditure. 4. Compare the actual average expenditure(from step 2) with the expected average expenditure(from step 4). The bug fixed successfully by adding BigDecimal to round up the calculated result of the actual average Expenditure. By rounding up the result to 2 decimals, the problem can be fixed and the actual result will then equal the expected result (169.67). |