Open 9teMare opened 2 years ago
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.
Team chose [response.Rejected
]
Reason for disagreement: [replace this with your explanation]
Reproduce the bug:
addc n/1 p/111111 e/111@gmail.com a/14 Jurong Street #01-01
addc n/2 p/222222 e/222@gmail.com a/14 Jurong Street #02-02
addc n/10 p/10101010 e/1010@gmail.com a/14 Jurong Street #010-10
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.
The bug is probably due to
sortc
only sort based onString
, instead of converting those numbers intoInteger
first then sort accordingly.