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.
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.
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 ...).
\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
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
\usepackage[locale=FR]{siunitx}
– Martin Thoma
Jan 13 '14 at 10:55
$\num{3.14}$ and $\num{3,14}$ to show up as 3,14. Is it possible to use both . and , as decimal separators and display the input faithfully? That is, $\num{3.14}$ gives 3.14, and $\num{3,14}$ gives 3,14. If it is, how? (May I suggest adding this information to the answer here to avoid a new question? :) )
– Linear Christmas
May 20 '21 at 18:07
! Package siunitx Error: Invalid number '\protect \text {0,001}'. and if the input is direct then siunitx works just fine. Why is that?
– user7351278
Dec 27 '22 at 17:51
\usepackage[spanish]{babel}all the number inputs with decimal in math mode get a,regardless the code being.or,. So, I'd have to change an option of the label package to make it display periods. Do you know how to do that? – Tomas Jun 16 '11 at 16:39\usepackage[spanish]{babel}you can use\decimalpointto use the point as decimal separator, and\decimalcommato revert to the comma. – Gonzalo Medina Jun 16 '11 at 16:53siunitxI tend to aim for consistency with current publishing practice. What is the situation 'on the ground' at the moment:.or,? – Joseph Wright Jun 16 '11 at 16:56\usepackage[spanish,es-nodecimaldot]{babel}should be enough. – egreg Jun 16 '11 at 16:56.for the decimal marker and\cdotfor exponents. I guess that means\,as the digit-grouping separator. What about between units (\,and\cdotseem to be the common choices)? – Joseph Wright Jun 16 '11 at 17:02.instead of,for decimal since everyone would understand it anyway. This should be something universal and i think it's better to use @egreg solution and leavesiunitxwith default settings. – Tomas Jun 16 '11 at 17:15\num{85+30i}\;\si\ohm? – Tomas Jun 16 '11 at 17:21