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 to a fixed number of characters would be a nice addition #8

Open
ddofborg opened this issue Nov 24, 2022 · 0 comments
Open

Format to a fixed number of characters would be a nice addition #8

ddofborg opened this issue Nov 24, 2022 · 0 comments

Comments

@ddofborg
Copy link

ddofborg commented Nov 24, 2022

Sometimes you want a fixed number of characters to be used for a number (for logging for example).

With 5 characters (this includes numbers, decimal points and magnitude):

4000000 => 4.00M
40000   => 40.0K
4000    => 4.00K
400     => 0.40K (400 and 400.0 are wrong as they take 3 and 5 places)
40      => 0.04K or 40.00
4       => 4.000
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

No branches or pull requests

1 participant