[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Accounting with Lua
- From: René Rebe <rene@...>
- Date: Mon, 08 Sep 2008 12:35:17 +0200
David Kastrup wrote:
Asko Kauppi <firstname.lastname@example.org> writes:
Some weeks ago, I had a hard disk problem that basically wiped out my
accounting software (last Windows application I was using). About
I considered the options (€ 300 upgrade for the same software) and
decided to just do it with Lua.
This is only for my own usage (as Linux was for Linus...) but I'd like
to hear if anyone else is using Lua for their SOHO business or
I'm using Lua as the data description language for transactions (no
database), and some hundreds of lines of "main code" create reports
for monthly and yearly taxation. Printing bills using LuaCairo (into
PDF) will be the next stage, and there I shall stop.
Well, there is the obvious advice: do the accounting in cents, not in
dollars. Lua can represent multiples of 1 exactly, but not multiples of
0.01. So if you are doing your calculations in dollars, at some point
of time the cents will not add up properly.
And this also only up to 2^32, ... which is why spread-sheet apps and other
serious accounting stuff uses bignum libraries ...
René Rebe - ExactCODE GmbH - Europe, Germany, Berlin
http://exactcode.de | http://t2-project.org | http://rene.rebe.name