One large number in table with decimalsHow to use siunitx and tabularx together?number separator formatting with ragged right positioning using siunitx, R, Hmisc::latexAlign decimal marker with thousands separator using siunitxScientific Notation Only For Large Numbersusing the package siunitxAlignment in tables using siunitxDuplicate decimal marker (siunitx)Problem aligning decimals in multi-column tableWrong value with Decimals and Uncertainty in siunitxAlign large numbers and small ones on comma and decimal point
Why aren't there more Gauls like Obelix?
Unidentified signals on FT8 frequencies
How do I align tablenotes in a threeparttable
What can I do if someone tampers with my SSH public key?
Multi wire circuit or 2 separate 120V 20A dedicated circuits?
Tabular environment - text vertically positions itself by bottom of tikz picture in adjacent cell
Why restrict private health insurance?
How to install "rounded" brake pads
std::string vs const std::string& vs std::string_view
How does learning spells work when leveling a multiclass character?
How does a sound wave propagate?
I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?
Should I file my taxes? No income, unemployed, but paid 2k in student loan interest
Boss Telling direct supervisor I snitched
Draw this image in the TIKZ package
Too soon for a plot twist?
Finding integer solution to a quadratic equation in two unknowns
How spaceships determine each other's mass in space?
Short story about cities being connected by a conveyor belt
Was this cameo in Captain Marvel computer generated?
Should I apply for my boss's promotion?
A vote on the Brexit backstop
School performs periodic password audits. Is my password compromised?
How to make sure I'm assertive enough in contact with subordinates?
One large number in table with decimals
How to use siunitx and tabularx together?number separator formatting with ragged right positioning using siunitx, R, Hmisc::latexAlign decimal marker with thousands separator using siunitxScientific Notation Only For Large Numbersusing the package siunitxAlignment in tables using siunitxDuplicate decimal marker (siunitx)Problem aligning decimals in multi-column tableWrong value with Decimals and Uncertainty in siunitxAlign large numbers and small ones on comma and decimal point
I am using siunitx to align numbers in a column. Problem is I got by intention one row at the beginning which is a large number, indicated by ',' per 1,000. See the following example.
What I would like to achieve:
1) Align the decimals to the decimal point '.' This is row 2, 3 and 4.
2) center the big numbers, i.e. row 1 and 5 in this example. When I tested different options, the large numbers where always either too much to the left or too much to the right. If possible, they should simply be centered. I believe that makes the most sense in terms of formatting.
Is it possible?
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-format = 2.2,
table-number-alignment = center,
%
begindocument
begintabularSS
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument
siunitx
add a comment |
I am using siunitx to align numbers in a column. Problem is I got by intention one row at the beginning which is a large number, indicated by ',' per 1,000. See the following example.
What I would like to achieve:
1) Align the decimals to the decimal point '.' This is row 2, 3 and 4.
2) center the big numbers, i.e. row 1 and 5 in this example. When I tested different options, the large numbers where always either too much to the left or too much to the right. If possible, they should simply be centered. I believe that makes the most sense in terms of formatting.
Is it possible?
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-format = 2.2,
table-number-alignment = center,
%
begindocument
begintabularSS
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument
siunitx
3
Try adding a pair of braces around the large numbers.
– Bernard
2 hours ago
@Bernard what do you mean precisely? I could add braces (could it be anything else but braces?), but I am not sure on the exact consequence of doing that. If I added them only on the left, what would happen? Pls elaborate a bit.
– ghx
2 hours ago
2
Apart from your question: Do not useStype columns for columns that only contain text (first column in your example code) and as already suggested by Bernard, enclose text inStype columns (first row in your code) as well as entries that should be centered in a pair of.
– leandriis
2 hours ago
Thanks that works! Does that just generally mean those numbers are ignored?
– ghx
2 hours ago
Yes: cell content between braces in anScolumn is considered by siunitx as non-numeric content and centred.
– Bernard
1 hour ago
add a comment |
I am using siunitx to align numbers in a column. Problem is I got by intention one row at the beginning which is a large number, indicated by ',' per 1,000. See the following example.
What I would like to achieve:
1) Align the decimals to the decimal point '.' This is row 2, 3 and 4.
2) center the big numbers, i.e. row 1 and 5 in this example. When I tested different options, the large numbers where always either too much to the left or too much to the right. If possible, they should simply be centered. I believe that makes the most sense in terms of formatting.
Is it possible?
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-format = 2.2,
table-number-alignment = center,
%
begindocument
begintabularSS
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument
siunitx
I am using siunitx to align numbers in a column. Problem is I got by intention one row at the beginning which is a large number, indicated by ',' per 1,000. See the following example.
What I would like to achieve:
1) Align the decimals to the decimal point '.' This is row 2, 3 and 4.
2) center the big numbers, i.e. row 1 and 5 in this example. When I tested different options, the large numbers where always either too much to the left or too much to the right. If possible, they should simply be centered. I believe that makes the most sense in terms of formatting.
Is it possible?
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-format = 2.2,
table-number-alignment = center,
%
begindocument
begintabularSS
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument
siunitx
siunitx
edited 2 hours ago
ghx
asked 2 hours ago
ghxghx
274
274
3
Try adding a pair of braces around the large numbers.
– Bernard
2 hours ago
@Bernard what do you mean precisely? I could add braces (could it be anything else but braces?), but I am not sure on the exact consequence of doing that. If I added them only on the left, what would happen? Pls elaborate a bit.
– ghx
2 hours ago
2
Apart from your question: Do not useStype columns for columns that only contain text (first column in your example code) and as already suggested by Bernard, enclose text inStype columns (first row in your code) as well as entries that should be centered in a pair of.
– leandriis
2 hours ago
Thanks that works! Does that just generally mean those numbers are ignored?
– ghx
2 hours ago
Yes: cell content between braces in anScolumn is considered by siunitx as non-numeric content and centred.
– Bernard
1 hour ago
add a comment |
3
Try adding a pair of braces around the large numbers.
– Bernard
2 hours ago
@Bernard what do you mean precisely? I could add braces (could it be anything else but braces?), but I am not sure on the exact consequence of doing that. If I added them only on the left, what would happen? Pls elaborate a bit.
– ghx
2 hours ago
2
Apart from your question: Do not useStype columns for columns that only contain text (first column in your example code) and as already suggested by Bernard, enclose text inStype columns (first row in your code) as well as entries that should be centered in a pair of.
– leandriis
2 hours ago
Thanks that works! Does that just generally mean those numbers are ignored?
– ghx
2 hours ago
Yes: cell content between braces in anScolumn is considered by siunitx as non-numeric content and centred.
– Bernard
1 hour ago
3
3
Try adding a pair of braces around the large numbers.
– Bernard
2 hours ago
Try adding a pair of braces around the large numbers.
– Bernard
2 hours ago
@Bernard what do you mean precisely? I could add braces (could it be anything else but braces?), but I am not sure on the exact consequence of doing that. If I added them only on the left, what would happen? Pls elaborate a bit.
– ghx
2 hours ago
@Bernard what do you mean precisely? I could add braces (could it be anything else but braces?), but I am not sure on the exact consequence of doing that. If I added them only on the left, what would happen? Pls elaborate a bit.
– ghx
2 hours ago
2
2
Apart from your question: Do not use
S type columns for columns that only contain text (first column in your example code) and as already suggested by Bernard, enclose text in S type columns (first row in your code) as well as entries that should be centered in a pair of .– leandriis
2 hours ago
Apart from your question: Do not use
S type columns for columns that only contain text (first column in your example code) and as already suggested by Bernard, enclose text in S type columns (first row in your code) as well as entries that should be centered in a pair of .– leandriis
2 hours ago
Thanks that works! Does that just generally mean those numbers are ignored?
– ghx
2 hours ago
Thanks that works! Does that just generally mean those numbers are ignored?
– ghx
2 hours ago
Yes: cell content between braces in an
Scolumn is considered by siunitx as non-numeric content and centred.– Bernard
1 hour ago
Yes: cell content between braces in an
Scolumn is considered by siunitx as non-numeric content and centred.– Bernard
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
For some reason your code compiles, but:
1) You should not (at least you have no reason to do that) use an S column type for columns that doesn't contain math.
2) If the contents of a cell inside an 'S' column is text place it inside curly braces. (This way the content will be centered by default from siunitx because it will be considered as a text). [See your "broken" alignToDec in the second column if outside of braces and place it inside braces to see the difference]
3) Use the same method as above for your big numbers...
4) You could specify the table-format as an optional argument in your S columns. (siunitx behaves better like this in general)
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-number-alignment = center,
%
begindocument
begintabularcS[table-format=2.2]
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument

PS: Remove the luatex tag.
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478492%2fone-large-number-in-table-with-decimals%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For some reason your code compiles, but:
1) You should not (at least you have no reason to do that) use an S column type for columns that doesn't contain math.
2) If the contents of a cell inside an 'S' column is text place it inside curly braces. (This way the content will be centered by default from siunitx because it will be considered as a text). [See your "broken" alignToDec in the second column if outside of braces and place it inside braces to see the difference]
3) Use the same method as above for your big numbers...
4) You could specify the table-format as an optional argument in your S columns. (siunitx behaves better like this in general)
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-number-alignment = center,
%
begindocument
begintabularcS[table-format=2.2]
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument

PS: Remove the luatex tag.
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
add a comment |
For some reason your code compiles, but:
1) You should not (at least you have no reason to do that) use an S column type for columns that doesn't contain math.
2) If the contents of a cell inside an 'S' column is text place it inside curly braces. (This way the content will be centered by default from siunitx because it will be considered as a text). [See your "broken" alignToDec in the second column if outside of braces and place it inside braces to see the difference]
3) Use the same method as above for your big numbers...
4) You could specify the table-format as an optional argument in your S columns. (siunitx behaves better like this in general)
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-number-alignment = center,
%
begindocument
begintabularcS[table-format=2.2]
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument

PS: Remove the luatex tag.
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
add a comment |
For some reason your code compiles, but:
1) You should not (at least you have no reason to do that) use an S column type for columns that doesn't contain math.
2) If the contents of a cell inside an 'S' column is text place it inside curly braces. (This way the content will be centered by default from siunitx because it will be considered as a text). [See your "broken" alignToDec in the second column if outside of braces and place it inside braces to see the difference]
3) Use the same method as above for your big numbers...
4) You could specify the table-format as an optional argument in your S columns. (siunitx behaves better like this in general)
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-number-alignment = center,
%
begindocument
begintabularcS[table-format=2.2]
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument

PS: Remove the luatex tag.
For some reason your code compiles, but:
1) You should not (at least you have no reason to do that) use an S column type for columns that doesn't contain math.
2) If the contents of a cell inside an 'S' column is text place it inside curly braces. (This way the content will be centered by default from siunitx because it will be considered as a text). [See your "broken" alignToDec in the second column if outside of braces and place it inside braces to see the difference]
3) Use the same method as above for your big numbers...
4) You could specify the table-format as an optional argument in your S columns. (siunitx behaves better like this in general)
documentclassarticle
usepackagesiunitx
sisetup%
input-ignore=,,
input-decimal-markers = .,
table-number-alignment = center,
%
begindocument
begintabularcS[table-format=2.2]
row & alignToDec \
row1: & 19,000,000.0 \
row2: & 12.38 \
row3: & 1.97 \
row4: & 91.01 \
row5: & 87,000,000.0 \
endtabular
enddocument

PS: Remove the luatex tag.
answered 2 hours ago
koleygrkoleygr
12.1k11038
12.1k11038
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
add a comment |
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
thanks a lot! My code always compiles ;)
– ghx
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
Welcome... For me, rarely it compiles by the first try when using siunitx... (but usually my tables are somehow ... somehow)... Anyway... I tried to say that usually siunitx doesn't like text when is waiting for numbers and doesn't compile without errors. Happy TeXing
– koleygr
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
No offense taken. Have a great day and thx for your reply.
– ghx
2 hours ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478492%2fone-large-number-in-table-with-decimals%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Try adding a pair of braces around the large numbers.
– Bernard
2 hours ago
@Bernard what do you mean precisely? I could add braces (could it be anything else but braces?), but I am not sure on the exact consequence of doing that. If I added them only on the left, what would happen? Pls elaborate a bit.
– ghx
2 hours ago
2
Apart from your question: Do not use
Stype columns for columns that only contain text (first column in your example code) and as already suggested by Bernard, enclose text inStype columns (first row in your code) as well as entries that should be centered in a pair of.– leandriis
2 hours ago
Thanks that works! Does that just generally mean those numbers are ignored?
– ghx
2 hours ago
Yes: cell content between braces in an
Scolumn is considered by siunitx as non-numeric content and centred.– Bernard
1 hour ago