# Remove leading 0 in siunitx

I am trying to create a big table without leading zeros using siunitx \num{}. Namely, I have a bunch of number formated like this:

0.001
0.1
1.000


and I want to remove the 0. part. So the output would be:

.001
.1
1.000


It should be the opposite of add-integer-zero option (something like remove-integer-zero). I have triyed lots of \sisetup configuration without luck. All question in tex exchange seems to be the opposite to what I want. Any idea of it is possible?

• Please show us an MWE showing your table. Do you need any other siunitx actions like aligning? Apr 21, 2014 at 11:54
• Removing the leading zero is not recommended. Apr 21, 2014 at 12:02
• Welcome to TeX.SX! Apr 21, 2014 at 12:11
• \sisetup{add-integer-zero=false} is the way to remove the leading zero, but don't do it. Apr 21, 2014 at 12:14
• @egreg: add-integer-zero=false will not add an integer zero, .001 would be kept, but the option does not remove a zero from the input. AFAIK the requested feature is not supported by siunitx. Apr 21, 2014 at 12:19

I agree with the comments about this not being a good idea. But having said that, here's an approach, using the expl3 syntax that siunitx is built upon:

\documentclass{article}
\usepackage{siunitx}
\ExplSyntaxOn

\fp_compare:nTF { 0 < \fp_abs:n { #1 } < 1 }
{
}
{ #1 }
}

\seq_set_split:Nnn \l_ae_integer_decimal_parts_seq {.} {#1}
\fp_compare:nF {#1>0}
{ - }
.\seq_item:Nn \l_ae_integer_decimal_parts_seq {2}
}

\ExplSyntaxOff
\begin{document}


• @cruzki If everything is up-to-date, then I'm not sure why it wouldn't work. Perhaps you should post a new question showing what you've tried so we can try to figure out why it's not working for you. I know that's a bit of a lame response, but without knowing more about what you're doing, it's hard to say. One thing you could try is add \listfiles in your preamble. That will inform you about versions of packages. When I do that it tells me that my version of expl3 is expl3.sty 2014/01/07 v4646 L3 Experimental code bundle wrapper Apr 22, 2014 at 19:00