Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number formatting is sometimes wrong for profile karma #3201

Closed
4 tasks
brendanheywood opened this issue Jun 19, 2018 · 2 comments
Closed
4 tasks

number formatting is sometimes wrong for profile karma #3201

brendanheywood opened this issue Jun 19, 2018 · 2 comments

Comments

@brendanheywood
Copy link
Member

brendanheywood commented Jun 19, 2018

What happened?

Example url(s) to reproduce the problem:

https://www.thecrag.com/climber/anderlnought

1126.0k
image

What you expected:

  • should be ~400k
  • add unit tests for various numbers and where they drop significant figures
  • add flags to have more or less sig fig, eg 1126.0k vs 1126k vs 1.1m
  • have flag to return raw number and units so this can be passed onto the bigstats component to render properly instead of the units being part of the number text
@brendanheywood brendanheywood added 2: Bug fix Feature that does not work as intended, broken UI, problem that detract from normal user experience Area: Climbers / Profile labels Jun 19, 2018
@brendanheywood brendanheywood self-assigned this Jun 24, 2018
@brendanheywood brendanheywood assigned scd and unassigned brendanheywood Aug 22, 2018
@scd
Copy link
Member

scd commented Sep 4, 2018

@brendanheywood I think anderl's karma is right. Here it is in the json:

"totalKarma": "1151190",

Why do you think it should be about 400k? If it should be about 400k then there is a deeper problem because it is wrong in the json.

I have found no other evidence that the display is wrong.

I have created some tests Translate.pm/formatNumber.t and it seems ok

I don't think we want significant figures by default if we are converting to k and the number is greater then say 20k. I have just added some logic for this. So Anderl's karma will now read 1151k instead of 1151.2k

We can add the other logic in as needed. We probably want to extend to the million unit.

@brendanheywood I don't propose to do any more for the profile release.

@scd scd removed the 2: Bug fix Feature that does not work as intended, broken UI, problem that detract from normal user experience label Sep 4, 2018
@brendanheywood
Copy link
Member Author

I think is probably an inconsistency between the facets or perhaps the area karma stats. I should have added a link for the second place. Let’s kill this for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants