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

Added roundSig #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added roundSig #10

wants to merge 1 commit into from

Conversation

hasko
Copy link

@hasko hasko commented Feb 28, 2022

I found it useful to round a float to a given number of significant digits, i.e. roundSig 3 1234.5 would give "1230" while roundSig 3 1.2345 would give "1.23". I need this because I'm working with exponential scales. I thought it might be a simple but useful extension to this module. Closes #11.

@myrho
Copy link
Owner

myrho commented Feb 28, 2022

Thank you for your PR!

Would it make sense to have floorSig and ceilingSig variants also?

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.

Round to significant number of digits
2 participants