10

Is there a package I could use to insert a space instead of a comma for large numbers?

For example,

12 345.67

instead of

12,345.67

If needed, I am using the extbook environment. All of my numbers are in math mode.

Edit: Is there a way I can do this formatting without having to type in num (from siunitx) for every single number?

1 Answer 1

13

Numbers can be formatted with package siunitx:

\documentclass{article}
\usepackage{siunitx}

\begin{document}
\num{12345.67}  
\end{document}  

Result

The space can be configured via option group-separator. Its default is a small space (\,).

3
  • Is there a way I can do this without manually typing \num prior to each number? Commented Jun 27, 2014 at 4:53
  • 2
    @Clarinetist: Package siunitx provides column type S for numbers inside tables. Otherwise digits would have to be made active. This cannot be done without breaking many other things, because numbers are used in many circumstances (\hspace{2em}, \multicolumn{4}{...}{...}, ...) Commented Jun 27, 2014 at 5:18
  • 3
    @Clarinetist: In some contexts (like a tabular, in a number-only column, say), yes. In general, not really.
    – Werner
    Commented Jun 27, 2014 at 5:18

You must log in to answer this question.

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