Skip to content

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

Open

Description

@josephwright

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.

Activity

  1. josephwright commented on Apr 3, 2023

    @josephwright
    OwnerAuthor

    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.

  2. Gerald-Meyers commented on Apr 3, 2023

    @Gerald-Meyers

    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.

  3. josephwright commented on Apr 3, 2023

    @josephwright
    OwnerAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions