ucsb-cs156-f23 / proj-happycows-f23-5pm-4

https://ucsb-cs156-f23.github.io/proj-happycows-f23-5pm-4/
1 stars 0 forks source link

BUG: Leaderboard table component sort by total wealth functionality gives incorrect result #18

Open github-actions[bot] opened 11 months ago

github-actions[bot] commented 11 months ago

Have you updated the title?

Summary

Leaderboard table component has a column called "Total Wealth" which displays all users' current wealth of a specific common. And this column as the sorting ability, but in this case it is not working as intended. For example, users with 10000 dollars will have lower ranks than users with 198 dollars.

Screenshot 2023-11-15 at 5 49 29 PM

Expected Behavior

When sorted in ascending order by total wealth , users should be displayed in ascending order in a correct way. Namely, 0 < 100 < 500 < 999 < 1000 and so on instead of the random order the website displays right now.

Current / Observed Behavior

When sorted by total wealth, leaderboard table does't list users in the correct order at the moment. For example, users with 10000 dollars will have lower ranks than users with 198 dollars, which is not what we want.

Screenshot 2023-11-15 at 5 51 15 PM

Steps to Reproduce

  1. Join a common.
  2. Have enough users in that common.
  3. Each users can buy some cows and sell some cows so that they have different total wealth. Let's say in this case, $8, $2308, $9999, $1.5 respectively for four active users in that common.
  4. Sort the users by total wealth
  5. Check if the users are listed in the correct order based on their current wealth.

Browser / Platform Info

Chrome on macOS Ventura 13.3

github-actions[bot] commented 11 months ago

Copied from https://github.com/ucsb-cs156/proj-happycows/issues/86