The xlop package 0.26 allows you to do French divisions like this:
\documentclass{article}
\usepackage{xlop}
\begin{document}
“french” division:
\opdiv{31}{45}
\end{document}
Output:

It can stop as soon as the period found
\documentclass{article}
\usepackage{xlop}
\begin{document}
With inline mode:
\opdiv[maxdivstep=5,style=text]{31}{45}
Stop with period detection:
\opdiv[period,style=text]{31}{45}
\end{document}
Output:

Star macros allow calculations to be performed without displaying the result. In the case of division, the \opdiv*{31}{45}{q}{r} macro stores the quotient (q) and the rest (r) in two parameters.
Three macros allow a control about precision. They allow to approximate a number giving the rank of the approximation. There are \opfloor (default approximate value), \opceil (excess approximate value), and \opround (rounding)
\documentclass{article}
\usepackage{xlop}
\begin{document}
Approximation:
\opdiv*[maxdivstep=15]{31}{45}{q}{r}
\opfloor{q}{7}{a}
\opceil{q}{10}{b}
\opround{q}{13}{c}
\opprint{a}
\opprint{b}
\opprint{c}
\end{document}
Output:

\numexprreturns an integer number and rounds. Therefore, the result of 31/45 is1, not0. – Heiko Oberdiek Apr 05 '18 at 17:12fporxfppackages for real-number mathematics, for example. I believepgfbased packages also provide such facilities. – Steven B. Segletes Apr 05 '18 at 17:13