[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Rounding problem with invoice.sty



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oliver,

I've been using invoice.sty for a while now, and have noticed a strange
and annoying rounding error. I don't know enough about latex components
to fix it -- I hacked a workaround for any specific cases I needed.

Essentially, what happens when you give a decimal number, like 12.34 in
the attached example, is it gets reduced to 12.399999999 by (I think)
realcalc, and then rounded down in lines 787 and 793 of invoice.sty (if
I'm correct) to 12.33. The end result is that the invoice amount doesn't
total correctly to the component rates * units.

Lines 787 and 793 are :
   \Rmul\r#1{0.01}%% <- Reduce to BaseCurrency

This could be an issue with realcalc as opposed to invoice, so I've cc'd
the realcalc maintainer on this mail aswell. I've also cc'd
debian-tex-maint since that's where I got the packages from!

- -- 
John Madden -- john@jmadden.eu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFLg0RQBw+ZtKOvTIRAjpAAJ4k85nLlkIAmVaqoI3jVMBz7h6XiACeMWp2
V5NEZjVLKD6Rn3cV9JKjfOA=
=Xnhk
-----END PGP SIGNATURE-----
\documentclass[11pt]{article}
\usepackage{invoice}
\begin{document}

\begin{invoice}{Euro}{0}
\ProjectTitle{Test}
\Fee{Test payment}{12.34}{10}
\end{invoice}

\end{document}

Reply to: