I have been having troubles with the following issue:
I am making an invoice template in LaTeX. I use \addtocounter to calculate values like subtotal, tax and total. This works fine, until the value contains a decimal number (which happens often in invoices of course). To counter this, I use the calc package in order to do: \addtocounter{subtotal}{\real{19.95}}. This works fine too.
However, when I load the package numprint or siunitx so that my numbers are correctly formatted on the decimal in the invoice table, I get the error:
/Invoices/A4.tex:22 Missing number, treated as zero \addtocounter{subtotal}{\real{19.95}}
As soon as I remove those two packages, all works fine again.
My question: is there a way to format numbers in a table while still being able to calculate the totals using decimal numbers?
You can find the code here: https://www.overleaf.com/4958478dccytf#/15308055/
Note that the code includes an invoice.cls and that an example of the problem can be found in the main page on line 22 and 23.
\realdoes not provide integer numbers, apparently, which are desperately needed by counter registers – Apr 20 '16 at 20:46LaTeX 3method is more appropiate here! – Apr 20 '16 at 21:01