# Comma as decimal marker with siunitx (Spanish usage)

I'm using siunitx to input some big numbers and units in my document.

Is there a way to make the output of \num{3.14} be "3,13" instead of "3.13"? In Spanish, we use the first one.

-
–  Andrey Vihrov Jun 16 '11 at 5:32
@Andrey: A tip: If you copy and paste the entire URL of a tex.sx question in your comment, it'll automatically get shortened and display the question when you mouseover the link, e.g. http:// tex.stackexchange .com /questions/18673/german-language-use-of-comma-in-numbers (w/o spaces) becomes tex.stackexchange.com/questions/18673/… –  doncherry Jun 16 '11 at 8:07
@Tomas: Wait ... did you actually want to get 3,1_3_ when you input 3.1_4_? –  doncherry Jun 16 '11 at 8:48
@Tomas: the ISO norm 80000-1, accepts both the period and the comma as decimal separator, and in the most recent version of the Ortografía de la lengua española, our Academia recommends the use of the period as decimal separator, although the comma is still accepted. More information here: La marca decimal –  Gonzalo Medina Jun 16 '11 at 12:55
@Tomas: \usepackage[spanish,es-nodecimaldot]{babel} should be enough. –  egreg Jun 16 '11 at 16:56

At the most basic

\sisetup{output-decimal-marker = {,}}


will do the job.

The package includes some pre-defined 'locales' for different typographic traditions, for example

\sisetup{locale = FR}


To date, I've not had details on Spanish conventions, so do not have an ES locale (there is more than just the decimal marker to worry about). In particular, what do you use for the exponent, 1.23 \times 10^{3} or 1.23 \cdot 10^{3} (or ...).

-
Thanks. We use \cdot for exponents. \times is more used for operations like vector products. Oh, i almost forgot. We use period for thousand separation. –  Tomas Jun 16 '11 at 16:43
@Thomas: How do you write a 3D point (spherical coordinate system), for example, (21.3,30.5,10) in Spanish? –  Please don't touch May 14 '12 at 8:33
@Joseph I think a single locale for Spanish is not possible. Very likely we need ES_es, ES_mx, ES_ar, and so on. –  Javier Bezos Oct 17 '12 at 14:00
@JavierBezos No, that would be confusing locale and language. ES would be Spain, I guess MX is Mexico, and so on. (For example, FR does not mean the text is in French, it means that the typography follows the conventions in use in France.) –  Joseph Wright Oct 17 '12 at 15:42
You can also load the package with this option: \usepackage[locale=FR]{siunitx} –  moose Jan 13 at 10:55