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.

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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 (\,).

share|improve this answer
    
Is there a way I can do this without manually typing \num prior to each number? –  Clarinetist Jun 27 at 4:53
1  
@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}{...}{...}, ...) –  Heiko Oberdiek Jun 27 at 5:18
3  
@Clarinetist: In some contexts (like a tabular, in a number-only column, say), yes. In general, not really. –  Werner Jun 27 at 5:18

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.