Has someone any experience to share about implementing a system that deals with currency values? I have already been bitten by the problems described in http://floating-point-gui.de/ and I want to find a better way.
It does what you need, but is stuck at Lua 5.1. It depends on some Lua 5.1 features that were removed in 5.2, and would be a bit of work to redo. There have also been some updates to decNumber that ought to be incorporated if ldecNumber is updated. If you work on the library you might consider using decQuad (decimal128) if you can get by with 34 digits of precision; the present version of ldecNumber uses arbitrary precision decNumber set to 69 digits of precision.