I would like that digits in math formulae appear like ۰۱۲۳۴۵۶۷۸۹ rather 0123456789. Hence I would like that for example $2$ appears like ۲
Note: A related question has been asked here: Replacing Western Arabic numerals with Arabic–Indic numerals in formulas but that the solutions there cannot be used here since I don't use arabtex, I use arabxetex. Also I don't use luatex (I use xelatex for compiling the document), hence the solutions there do not apply in this situation.
\documentclass{article}
\usepackage{arabxetex}
\setromanfont[Mapping=tex-text]{Times New Roman}
\newfontfamily\farsifont[Script=Arabic]{Times New Roman}
\newfontfamily\arabicfont[Script=Arabic]{Times New Roman}
\begin{document}
\begin{farsi}
$a\sp2+b\sp2=c\sp2$
\end{farsi}
\end{document}