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

Feature: set significant figures #19

Open
bruce-ricard opened this issue Mar 28, 2020 · 1 comment
Open

Feature: set significant figures #19

bruce-ricard opened this issue Mar 28, 2020 · 1 comment

Comments

@bruce-ricard
Copy link

Hello,

I would like to be able NOT to use multiple different time units, but only one. For example, instead of 3 seconds 123 milliseconds, I'd like to get 3.123 seconds. I think it is easier to read this way. Even instead of 1 hour 30 minutes, I'd rather see 1.5 hours.

I would like to be able to, similarly to the function LimitFirstN, set the number of significant figures. A good name for the function could be WithSignificantFigures(int i). For example, if you set it to 3: 13 minutes 33 seconds would become 13.5 minutes. 3 minutes 15 seconds would become 3.25 minutes.

I would like to be able to print the international symbols of the time unit instead of their English word:

hour: h
minute: min
second: s
millisecond: ms
etc.

The thing I would ideally get for 1 second 234 milliseconds is 1.2s.

I am happy to try to make PRs for these 3 features. Would you be happy to accept them?
Thank you.

@hako
Copy link
Owner

hako commented Mar 28, 2020

Hey, @bruce-ricard, This is a very useful feature, I would be happy to accept your PR as long as they have some tests.

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