The following code works great for printing new input/output values on each build to PDF; but, I cannot get it to round to any decimal place. It always rounds to the nearest integer. I have tried \numprint and \sisetup approaches with no luck. Seems like a simple problem to solve; but, I have no luck deploying answers to similar questions on this forum. Ultimately, I'd like to be able to round to the right sig figs, and have even tried that with "round-places" and "round-figures" in whatever package those are part of...no luck.
\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{margin=1in}
\usepackage{pgf,amsmath,enumitem,siunitx}
\pgfmathsetseed{\number\pdfrandomseed} % seed for pseudo random generator
% new command to initialize variables
\newcommand\initVariables{%
\pgfmathsetmacro{\A}{random(100,200)}%
\pgfmathsetmacro{\B}{random(5,29)}%
}
% define command to calculate result
%\newcommand\answer{\pgfmathprint{round(\A / \B)}}
\newcommand\answer{\pgfmathprint{round(\A / \B)}}
\begin{document}
\begin{enumerate}
\initVariables % initialize variables
\item \textbf{An object is displaced \A \ meters in \B \ seconds.}\\
\begin{equation*}
v = \dfrac{\Delta s}{\Delta t} = \dfrac{\A \ m}{\B \ s} =
\pgfmathparse{\A / \B}\pgfmathresult \ \frac{m}{s}
\approx \answer \frac{m}{s}\\
\end{equation*}
round
is defined for integers.\pgfmathprintnumber[fixed, precision=1]{\answer}
should work\newcommand\answer{\pgfmathparse{\A/\B}\pgfmathprintnumber[precision=1]{\pgfmathresult}}
?