Q:

truncating numbers

I would like to truncate numbers in a table of mine such that numbers smaller than a threshold T are shown as <T. I thought the siunitx package had that functionality but I was wrong. I am sure this is a simple macro but I am new to macros in LaTeX.
\documentclass[11pt]{article}
\begin{document}

% threshold 0.001

\begin{table}
\begin{tabular}{rr}
input   & desired output \\
0.0009  & <0.001 \\
0.001   &  0.001 \\
0       & <0.001 \\
\end{tabular}
\end{table}

\end{document}

A:

With xparse and collcell:
\documentclass[11pt]{article}

\usepackage{collcell}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand \myminimum { m m }
  {
    \fp_compare:nNnTF { #2 } < { #1 }
      { $<$#1 }
      { #2 }
  }
\ExplSyntaxOff

\begin{document}

\begin{table}
  \begin{tabular}{r>{\collectcell{\myminimum{0.001}}}r<{\endcollectcell}}
    input   & \multicolumn{1}{r}{desired output} \\
    0.0009  &  0.0009 \\
    0.001   &  0.001 \\
    0       &  0 \\
  \end{tabular}
\end{table}

\end{document}

A variant of \myminimum that uses \num for the output and has an optional argument which is forwarded to \num.
\ExplSyntaxOn
\NewDocumentCommand \myminimum { O{} m m }
  {
    \fp_compare:nNnTF { #3 } < { #2 }
      { \mode_if_math:TF { < } { $<$ } \num [{#1}] { #2 } }
      { \num [{#1}] { #3 } }
  }
\ExplSyntaxOff

