The SI standard says:
Following the 9th CGPM (1948, Resolution 7) and the 22nd CGPM (2003, Resolution 10), for numbers with many digits the digits may be divided into groups of three by a thin space, in order to facilitate reading. Neither dots nor commas are inserted in the spaces between groups of three. However, when there are only four digits before or after the decimal marker, it is customary not to use a space to isolate a single digit. The practice of grouping digits in this way is a matter of choice; it is not always followed in certain specialized applications such as engineering drawings, financial statements, and scripts to be read by a computer.
The advantage of this is that it's unambiguous, whereas commas and dots are used alternately as decimal separators and thousands separators in different cultures.
I've been using the HTML character entity
to produce a thin space (e.g., 10 000). HTML character entities work in Stack Exchange questions and answers, but not in comments. However, it seems that browsers treat
&thinsp as a breakable space, so you might end up with 10
000 if you're unlucky. There is a non-breaking thin space, which you can get with
(e.g., 10 000), but that's kinda hard to remember... The character entity
is non-breaking, but it's a full-width space, which isn't appropriate for this usage.