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

Change how non data numbers are displayed #84

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

mdawar
Copy link
Contributor

@mdawar mdawar commented Aug 3, 2023

This is a possible fix for the number display issue presented in #83.

I have added a new function Nsize (With tests) that returns a human readable string representation of a number, but to be used for numbers that are not bytes like message counts.

I don't know if the the new function name Nsize is OK, I tried to be consistent with Psize.

For example the new function changes how these numbers are displayed:

  • 1000: Previously 1000 now 1.0K
  • 1_000_000: Previously 976.6K now 1.0M
  • 1_000_000_000: Previously 953.7M now 1.0B
  • 1_000_000_000_000: Previously 931.3G now 1.0T

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@wallyqs wallyqs merged commit 4bbff03 into nats-io:main Aug 3, 2023
@mdawar mdawar deleted the data-display branch August 3, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants