[Tex/LaTex] Transform big number into scientific format

calculationsformatting

I want to convert my big integer number into a shorter form; for example

\convert{123456789} = 1.23 x 10^9

Is there any package which allows me to do so?

Best Answer

The PGF math engine can do it.

In addition, the pgfplotstable package is quite powerful when it comes to rounding, formatting, and perhaps even postprocessing/generating numerical content.

\documentclass{standalone}

\usepackage{pgf}

\usepackage{pgfplotstable}

\begin{document}

\pgfmathprintnumber{123456789123456789123456789}

\pgfplotstabletypeset{
A B
1 123456789123456789123456789
2 9876543219876545432198765432222
}
\end{document}

enter image description here

Related Question