3

I am trying to round my angle to 3 significant figures, and the input is an expression rather than a number. It is easy for \qty and \num:

\num[evaluate-expression, round-mode=figures, round-precision=3, round-pad=false]{22/7} %3.14

However, it does not extend to \ang apparently. Similar options just won't take effect:

\ang[evaluate-expression, round-mode=figures, round-precision=3, round-pad=false]{22/7} %3.142857.....

I wonder why the same options will work for \num but not \ang as the siunitx manual does not mention that options apply only to specific functions, and what can I do in my case? Thanks.

2

1 Answer 1

2

This was an oversight which I've logged as https://github.com/josephwright/siunitx/issues/546. Until the hotfix is out, you can use

\cs_gset_protected:Npn \siunitx_angle:n #1
  {
    \bool_if:NTF \l__siunitx_angle_force_arc_bool
      { \exp_args:Ne \__siunitx_angle_arc_convert:n { \fp_eval:n {#1} } }
      {
        \siunitx_number_parse:nN {#1} \l__siunitx_angle_degrees_tl
        \siunitx_number_process:NN \l__siunitx_angle_degrees_tl \l__siunitx_angle_degrees_tl
        \tl_set:Nx \l__siunitx_angle_degrees_tl
          { \siunitx_number_output:NN \l__siunitx_angle_degrees_tl \q_nil }
        \__siunitx_angle_arc_print:VVV
          \l__siunitx_angle_degrees_tl
          \c_empty_tl
          \c_empty_tl
      }
  }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .