The MWE below suggests that truncating an fp
type number is not just for cosmetics but actually changes the number's value. Is there a way to reduce the number of decimals displayed without affecting the number's full accuracy in computations? I browsed through siunitx
but nothing jumped at me.
\documentclass{article}
% RN. 6 April 2017
% TOPIC:
% Truncating floating point numbers
%=======================
\usepackage[check-declarations]{expl3}
\usepackage{xparse}
%-----------------------
\ExplSyntaxOn
\NewDocumentCommand\myTruncatingFloatingPoints{mO{3.11998}O{3.0198}}
{
\fp_eval:n {trunc(#2,#1)*trunc(#3,#1)}
} % \myTruncatingFloatingPoints
\ExplSyntaxOff
%-----------------------
\begin{document}
1. Full complement of digits:~\myTruncatingFloatingPoints{5}
2. Truncated to 2 decimal digits:~ \myTruncatingFloatingPoints{2}
\end{document}