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

Uncertainty rounding for both uncertainties and non-uncertainties in one. #654

Open
josephwright opened this issue Apr 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@josephwright
Copy link
Owner

josephwright commented Apr 3, 2023

Split out from #652. Currently a user has to specify if they want the rounding to occur with uncertainty or figures. It would be very convenient if there was another rounding option smart that takes into consideration whether an uncertainty was provided. I could do something like:

\sisetup{ uncertainty-mode = separate, exponent-mode = scientific, round-mode = smart, }
\SI[round-precision=4]{3031523.20585698(74336.4927580466)}{\meter\per\second}

to get the equivalent of. Similarly

\SI{round-precision=3}{299 792 458 }{\meter\per\second} 

As it stands currently, if we use \sisetup{round-mode=uncertainty}, the second number fails to round to 3 significant digits and just prints out the same value.

@josephwright josephwright added the enhancement New feature or request label Apr 3, 2023
@josephwright
Copy link
Owner Author

I'm not so keen on this, as the meaning of the two types of rounding is very different. It's very likely that you need different rounding precision for the two cases. Also, rounding is really mainly for table columns, and it's very unlikely the data will be that heterogeneous. So whilst I won't close, I'm not minded to implement here.

@Gerald-Meyers
Copy link

Gerald-Meyers commented Apr 3, 2023

So is siunitx primarily inteded for table formatting (of homogeneous data)? I have been using it to format python output (without uncertainties) for single value outputs.

@josephwright
Copy link
Owner Author

@Gerald-Meyers Tables aren't the core aim for me of siunitx, but there is a lot of usage for tables. Of course, every user is different, but the main use case I imagine for rounding is reading external data files for automatic formatting. For one-off values in the document body, most people will I think simply type them in and so round appropriately themselves. Most automatic value reading will be for tables. But that doesn't mean people can't use it for whatever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants