Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to to round numbers in latex in a way, such that 1.23456e-10 rounded to two places becomes zero and not 1.23e-10.

One solution with siunitx is

\num[round-mode=places,scientific-notation = fixed,fixed-exponent = 0 ,round-precision = 2]{1.23456e-6}

But if the digits get too many (>10) it fails, with the the error message

! Number too big.

As explained in siunitx number too big when trying to round

the command

\num[round-mode=figures,round-precision=2]{1.0123456789012e-6}

had the same problems, which are fixed now.

But, if I add scientific-notation = fixed, then the error reappears.

Does anybody know a fix for that problem?

share|improve this question
4  
I'd suggest reporting it in the bug tracker (bitbucket.org/josephwright/siunitx/issues) :-) I have a couple of other issues to look at, so this should be doable by the weekend. –  Joseph Wright May 2 '12 at 14:04
    
@Joseph: I did. Would be great to see that fixed. Thanks a lot. –  Vince Busch May 2 '12 at 14:43
    
Bug fixed in source, CTAN update later today. –  Joseph Wright May 3 '12 at 9:36
add comment

1 Answer

Fixed in the current release of siunitx (v2.5c):

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\num
  [
    round-mode          = places,
    scientific-notation = fixed,
    fixed-exponent      = 0,
    round-precision     = 2
  ]{1.2345678901234567890e-6}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.