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

Max significant numbers formating #53

Closed
Benoss opened this issue Jun 14, 2015 · 6 comments
Closed

Max significant numbers formating #53

Benoss opened this issue Jun 14, 2015 · 6 comments

Comments

@Benoss
Copy link

Benoss commented Jun 14, 2015

Looking at the doc I can't find a way to fix the number of significant numbers. This is very useful when you are showing numbers in a fixed width container

For example if I want only 3 significant numbers:

  • 12345678=> 12.3m
  • 1234567=> 1.23m
  • 123456 => 123k
  • 12345 => 12.3k
  • 1234 => 1.23k
  • 123 => 123
  • 12.3 => 12.3
  • 1.23 => 1.23
  • 0.123 => 0.12
  • 0.0123 => 0.01

format string could be "3a" for this example

@BenjaminVanRyseghem
Copy link
Owner

You can use this format 00000 a by example, to fix the significant number to 5

But surprisingly enough, it doesn't work for a number of 0 lesser than 4 😕

I will investigate 😄

@BenjaminVanRyseghem
Copy link
Owner

Fix proposed 😄

I will also improve documentation in a separate issue #56

@BenjaminVanRyseghem
Copy link
Owner

In numbro 1.3.0

@Benoss
Copy link
Author

Benoss commented Jun 17, 2015

Thanks for the fix but I still don't get it for a precision of 2 and 3
In the doc:
1234567891 '2a' 1b
1234567891 '3a' 1b

should 3a be 1.23b
and 2a be 1.2b ?

@BenjaminVanRyseghem
Copy link
Owner

Yep, I noticed this.

I will have to investigate this

@BenjaminVanRyseghem
Copy link
Owner

Let's open a new ticket 😄

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