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

Format numbers over a Billion with a 'B' instead of a 'G' #6916

Closed
3 tasks done
sanjoyamazon opened this issue Feb 19, 2019 · 7 comments
Closed
3 tasks done

Format numbers over a Billion with a 'B' instead of a 'G' #6916

sanjoyamazon opened this issue Feb 19, 2019 · 7 comments
Labels
enhancement:request Enhancement request submitted by anyone from the community

Comments

@sanjoyamazon
Copy link

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Superset version

0.29

Expected results

For numbers that are greater than a Billion, 10**9, we would like to suffix the number with a 'B' instead of a 'G'.

Actual results

2.0G for 2,000,000,000

Steps to reproduce

Use any number greater than 1,000,000,000.

@kristw kristw added the #refine label Feb 20, 2019
@mistercrunch
Copy link
Member

mistercrunch commented Feb 20, 2019

G is the symbol for Giga. The format string we use is .3s out of d3.format() which is somewhat standard. While switching from G to B might make it more clear to you and some subset of users, it may make it more confusing to others, or the simple fact of changing it might confuse some.

I'm not opposing this change but just mentioning that there are pro/cons.

@kristw
Copy link
Contributor

kristw commented Feb 20, 2019

@mistercrunch The G thing has been bugging me for quite some time as well. I have implemented a new adaptive formatter and propose we use this one as default instead of .3~s. Please see the linked PR above.

@mistercrunch
Copy link
Member

👍 I'm open to this change.

@anddyhuaa
Copy link

yeah,that’s the problem i think the measurement more
flexible could never be better

@kristw
Copy link
Contributor

kristw commented Mar 15, 2019

Implemented in @superset-ui/number-format and integrated in #6982

@kristw kristw closed this as completed Mar 15, 2019
@kristw kristw added enhancement:request Enhancement request submitted by anyone from the community and removed #refine labels Mar 20, 2019
@chesterxgchen
Copy link

chesterxgchen commented Mar 27, 2020

B => billions only for certain numbers, count of files or users for example,
G => used for storage size, can not substitute by Billion. Superset should have different format choices depends on the use case, rather than interchange them

@kristw
Copy link
Contributor

kristw commented Mar 27, 2020

@chesterxgchen Yes, I can add more formatting choice. Will note that as feature request.
I believe B will be a better default at the moment as most cases are business reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement:request Enhancement request submitted by anyone from the community
Projects
None yet
Development

No branches or pull requests

5 participants