9teMare / pe

0 stars 0 forks source link

Sort command fails to sort names where names are numbers properly #2

Open 9teMare opened 2 years ago

9teMare commented 2 years ago

Reproduce the bug:

  1. addc n/1 p/111111 e/111@gmail.com a/14 Jurong Street #01-01
  2. addc n/2 p/222222 e/222@gmail.com a/14 Jurong Street #02-02
  3. addc n/10 p/10101010 e/1010@gmail.com a/14 Jurong Street #010-10
  4. sortc

Expected outcome: The company called 1 should come first, followed by the company called 2, finally followed by the company called 10.

Actual outcome: The company called 1 comes first, followed by the company called 10, finally followed by the company called 2.

image.png

The bug is probably due to sortc only sort based on String, instead of converting those numbers into Integer first then sort accordingly.

nus-pe-bot commented 2 years ago

Team's Response

This is intended behavior. This is also how many file managers will sort their files by names, so it's not really unexpected the sorting will sort names based on strings instead of converting them to integers first. This is especially true since most companies/events/persons will not have integer names. Not an issue.

Furthermore sorting the names after converting to integer will make it complicated for the users when the names of companies/events/persons contain both non-number and numbers.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: [replace this with your explanation]