-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix follower count truncation #5568
base: main
Are you sure you want to change the base?
Conversation
would this still leave a place to check somewhere the raw numbers on the UI? |
the |
what do we want to display for JP? |
4_999_999 should probably display 499万, right now with this change it displays 490万, in Actually, I wonder if other locales have their own scheme? Will see... |
I've checked. Chinese, Korean and Japanese seems to be the only ones problematic here (they follow the same scheme, 499万), perhaps we should just special case those three? (I could try fiddling with the truncation a little) |
this may be a separate thing tho |
In Japanese (and probably also in Chinese and Korean) the name of the power of 10 changes every 10^4. It is likely that where we currently calculate with 2, 5 or 8 digits for truncation, |
@mary-ext this seems like a bug in the FormatJS poly, right? I'm not seeing any open issues for this, and they state that it should be supported, so we may want to open an issue and see if we can get it fixed upstream. |
We should yeah, I think they're purposefully disabling tests for newer NumberFormat features and just never got round to it? I don't see anything wrt roundingMode on formatjs' repository other than the tests |
Fixes #5538
On mobile, apply our own truncation since NumberFormat polyfill doesn't support roundingMode option.
This may look wrong on some locales like JP locale where numbers get displayed weirdly (e.g. 5083801 -> 5M / 508.3万), perhaps we should just apply it to web as well?
From brief testing, this truncation should work up to 999_999_999_999_997, I don't think anyone will reach this value.