Math & Science ⇒ Norwegian comma vs period for decimal numbers.
Norwegian comma vs period for decimal numbers.
In Norway (and probably other places in Europe), however, we write a decimal number like this: "0,36704 (and never ,36704)" and a large number like this: "3 000 000"
If I use comma "," in math environment in latex, I get a small space to the right of it as a result of it mostly being used for coordinates. Is there a way to set it up in such a way that this space is removed by default?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Norwegian comma vs period for decimal numbers.

Code: Select all
\documentclass{article}
\usepackage{icomma}
\begin{document}
$(x, y) = (0, 3)$ % with desired space
and $z = 0,36704$.% no space after decimal separator
\end{document}
Norwegian comma vs period for decimal numbers.
Code: Select all
\documentclass{article}
\begin{document}
$(x,y)$ $0{,}1234$ $3\,000\,000$
\end{document}
\num
macro allows for very much customization of the printing of numbers. Here's a very short example:Code: Select all
\documentclass{article}
\usepackage{siunitx}
\sisetup{
add-decimal-zero = true , % default setting, not needed
output-decimal-marker = {,} ,
group-separator = \, % default setting, not needed
}
\begin{document}
\num{0,1234} \num{.1234} \num{3000000}
\num{2.} \num{3}
\end{document}
Re: Norwegian comma vs period for decimal numbers.
