[Tex/LaTex] Calculate prices


I want to calculate prices in a LaTex file. This means I want to add two numbers with exactly 2 decimal places and I want to multiply these values by an integer.

An other thing is the output format. The numbers should be printed like this: 1.234.567,89 (I want to use this in Germany, and there we write numbers like that).

I know there are many packages for calculation in LaTeX, but I assume/hope there is one especially for money values.

Best Answer


You might want to take a look at the mathematical capabilities of pgf. I prepared a MWE:

    /pgf/fpu = true,
    /pgf/number format/.cd,
    fixed zerofill,
    use comma,
    1000 sep={.}

The output will look something like this


To process huge numbers you need to load the fpu library. (Thank you, Jake)


Your questions is a little bit unclear, but if it is only about typesetting currency, you could abuse the siunitx package and do something like this

    group-separator = {.},
    round-mode = places,
    round-precision = 2,
    output-decimal-marker = {,}

Which leads to the following output