I'm trying to automatically format numbers in a way that doesn't convert say .8 to 0.8 while at the same time scientific notation is converted to exponent-free notation. siunitx seems to be able to do both but I don't get it to work together.
\documentclass{article}
\usepackage{siunitx}
\newcommand{\myround}[1]{\num[zero-decimal-to-integer,scientific-notation=fixed,fixed-exponent=0,round-mode=places,round-precision=2,add-integer-zero=false]{#1}}
%\newcommand{\myround}[1]{\num[zero-decimal-to-integer,round-mode=places,round-precision=2,add-integer-zero=false]{#1}}
\pagestyle{empty}
\begin{document}
\myround{.8}
\myround{1}
\myround{4.00000000001}
\myround{-.1151}
\myround{4.44089209850063E-16}
.80
1
4
-.12
0
\end{document}
The first \newcommand in this MWE IMHO should produce the right result because it got all the right options. However, the zeros before the decimal point are added back in:

Using the second macro definition (that is commented out) yields this result, proving that in principle it should work but of course the scientific notation isn't converted and not rounded properly either (rounding to two decimal places, 4.44×10-16 should be 0.00×100 if anything).

I also added the pgfmath tag because \pgfmathprintnumber seems to have much of the same options as \num from siunitx and I don't know if one uses the other internally and I also wouldn't mind to use that other if it does what I need.

numprintpackage! – Keks Dose Mar 12 at 17:14.80(or0.80for that matter). PGF’s math printing number andsiunitxare independent (though you can sendsiunitx’ settings to PGF). – Qrrbrbirlbel Mar 12 at 17:19siunitxcode works such that the two operations here are entirely separate. Forcing a fixed exponent is set up such that the output must have an integer part even if it's zero. I can of course look to alter this behaviour: the problem is getting the 'expected' interactions correct. – Joseph Wright♦ Mar 13 at 9:01