Graphics, Figures & Tablesdecimal numbers centering in cell

Information and discussion about graphics, figures & tables in LaTeX documents.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

decimal numbers centering in cell

Post by josephwright »

casperyc wrote: applying

Code: Select all

\sisetup{digitsep=comma,sepfour}
globally,
the deciamls got the comma as well.
e.g.
0.989,89
0.987,28

is there another command that can keep the decimals as
0.989 89
0.987 28

space seperated?

Thanks.
Not at the moment. I've never seen any published material where you see output such as "12,345.678 90". Can you point to a (publicly-accessible) example?
Joseph Wright

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

casperyc
Posts: 50
Joined: Thu Oct 15, 2009 11:23 pm

Re: decimal numbers centering in cell

Post by casperyc »

ok. that's fine then.

English is not my first language and to be honest, I have never seen numbers such as 0.999,39. that just looks weird to me.
if it is standard international (SI), then i will get used to it.

Thanks!

casper
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: decimal numbers centering in cell

Post by josephwright »

The international standard (as far as there is one) is to use thin spaces: 12\,345.678\,90. However, this is very variable. What I think is pretty conserved is that the same separator is used before and after the decimal mark, unless only one part is separated at all. (You do see 12,345.67890 with no decimal separator at all.)
Joseph Wright
casperyc
Posts: 50
Joined: Thu Oct 15, 2009 11:23 pm

decimal numbers centering in cell

Post by casperyc »

josephwright wrote:The international standard (as far as there is one) is to use thin spaces: 12\,345.678\,90. However, this is very variable. What I think is pretty conserved is that the same separator is used before and after the decimal mark, unless only one part is separated at all. (You do see 12,345.67890 with no decimal separator at all.)
yes, i do see 12,345.67890!
is there a way to get rid of the ',' in the decimals then?
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

decimal numbers centering in cell

Post by josephwright »

casperyc wrote: yes, i do see 12,345.67890!
is there a way to get rid of the ',' in the decimals then?
Slightly complicated answer. I'm currently working on siunitx vision 2. It does have the appropriate option, but as yet is (a) not finished (b) does not handle tables. Version 1 does not have an option, and for various reasons retro-fitting one is not something I'm keen on.

That said, a quick hack should achieve what you want:

Code: Select all

\documentclass{article}
\usepackage{booktabs,siunitx}
\makeatletter
\renewcommand*{\si@num@dec}[1]{\def\si@num@postdec{#1}}
\makeatother
\sisetup{digitsep=comma,sepfour}
\begin{document}

\begin{tabular}{
  S[tabformat=6.6]
}
  \toprule
    {Heading} \\
  \midrule
    111111.111111 \\
    222222.222222 \\
    333333.333333 \\
  \bottomrule
\end{tabular}

\end{document}
Joseph Wright
casperyc
Posts: 50
Joined: Thu Oct 15, 2009 11:23 pm

decimal numbers centering in cell

Post by casperyc »

josephwright wrote:
casperyc wrote: yes, i do see 12,345.67890!
is there a way to get rid of the ',' in the decimals then?
Slightly complicated answer. I'm currently working on siunitx vision 2. It does have the appropriate option, but as yet is (a) not finished (b) does not handle tables. Version 1 does not have an option, and for various reasons retro-fitting one is not something I'm keen on.

That said, a quick hack should achieve what you want:
There is a version 2 beta ?

God, latex does have a lot of wonderful packages
thanks to all contributors like you!

there are too many though, sometimes, just dont know where ( or which one ) to look into.

Thank you.

casper
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

decimal numbers centering in cell

Post by josephwright »

casperyc wrote: There is a version 2 beta ?
Not just yet. There is development code for version 2, to address some fundamental issues with the current release (I get quite a number of feature requests and many need a more flexible base layer). However, at present I would not call it "beta" as there are big gaps (for example, no table support just yet).
Joseph Wright
Post Reply