nus-cs2103-AY2223S1 / pe-dev-response

0 stars 0 forks source link

Price filter accepts invalid input #4584

Open nus-pe-bot opened 1 year ago

nus-pe-bot commented 1 year ago

Steps to reproduce: enter: range -p l/9,9,9 u/1,0,0,0

Expected: Error message thrown since inputted prices are invalid

Actual: Accepted as valid input

Screenshot: image.png


[original: nus-cs2103-AY2223S1/pe-interim#4519] [original labels: type.FunctionalityBug severity.Low]

misterpuffin commented 1 year ago

Team's Response

Thanks for raising the issue! Actually, referring to the UG section on the range command. It mentions:

Lower and upper price boundaries only accept positive integer values (commas in between digits are acceptable; see Prefix List for acceptable comma usage).

From the Prefix List:

Use of commas to separate digits allowed, except when commas is in front of leading digit (,100), comma not between digits (100,) or using consecutive commas (10,,0)

In fact, 1,0,0,0 is indeed considered a valid input, and is recognized as 1000. This design decision is based on the fact that not all countries use the convention of grouping their numbers in 1000s. One such example would be the Indian Numbering System. The use of delimiters is solely a feature to help make the user input's more readable for the user, and we give the users flexibility to delimit the numbers however they want.

Duplicate status (if any):

--