Skip to content

Added roundSig#10

Open
hasko wants to merge 1 commit into
myrho:masterfrom
hasko:master
Open

Added roundSig#10
hasko wants to merge 1 commit into
myrho:masterfrom
hasko:master

Conversation

@hasko

@hasko hasko commented Feb 28, 2022

Copy link
Copy Markdown

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

myrho commented Feb 28, 2022

Copy link
Copy Markdown
Owner

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