Bawfen / pe

0 stars 0 forks source link

Unexpected result in filter after adding in an item with price less than 0.01 #2

Open Bawfen opened 1 year ago

Bawfen commented 1 year ago

The system allows you to add items with prices below 0.01 (with 3 decimal places) Screenshot 2023-04-14 at 4.33.10 PM.png

When calling filter, it returns the result when using the query "filter f/price p/gt 0" Screenshot 2023-04-14 at 4.29.09 PM.png

While it is technically correct to return this to the user, I believe that it might be confusing as the amount shown in the result is equal to the "0" which was queried.

Perhaps it might be better to return an error when adding the item or show more decimal places in the filtered result?

nus-pe-script commented 1 year ago

Team's Response

No details provided by team.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

'filter f/price p/lt [price]' command is supposed to give me less than but also gives equals to

image.png


[original: nus-cs2113-AY2223S2/pe-interim#1051] [original labels: type.FunctionalityBug severity.Medium]

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

image.png

Filter can produce seemingly wrong results when item prices are more than 2 decimal places. This is because we allow more than 2dp pricing for advanced users who are selling in bulk but still want to keep individual items instead of groups of items. E.g. for a user selling 100 screws at $4.50, each Screw Item would have a price of $0.045. We made the change to display prices as 2 decimal places as there were complaints of allowing more than 2dp pricing, but we did not want to limit the options of advanced users.

A possible middle ground is to add a For Advanced Users section in relevant parts of the UG in the next iteration.

However, as demonstrated, normal users setting prices to 2dp or less do not experience the bug.

Items for the Tester to Verify

:question: Issue duplicate status

Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)

Reason for disagreement: [replace this with your explanation]


## :question: Issue response Team chose [`response.NotInScope`] - [ ] I disagree **Reason for disagreement:** [replace this with your explanation]
## :question: Issue type Team chose [`type.DocumentationBug`] Originally [`type.FunctionalityBug`] - [ ] I disagree **Reason for disagreement:** [replace this with your explanation]