Asko Kauppi | 7 Sep 20:18
Gravatar

Accounting with Lua


Some weeks ago, I had a hard disk problem that basically wiped out my  
accounting software (last Windows application I was using). About time.

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  
personal finances.

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.

-asko

David Kastrup | 8 Sep 11:15

Re: Accounting with Lua

Asko Kauppi <askok <at> dnainternet.net> writes:

> Some weeks ago, I had a hard disk problem that basically wiped out my
> accounting software (last Windows application I was using). About
> time.
>
> 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
> personal finances.
>
> 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.

--

-- 
David Kastrup

Gravatar

Re: Accounting with Lua

And in addition to David's advice, do remember that money (and time)
are complex data-types. Trying to treat them as numbers is a bad idea.

Take a look at: http://timeandmoney.sourceforge.net/

--
troels

On Mon, Sep 8, 2008 at 11:15 AM, David Kastrup <dak <at> gnu.org> wrote:
> Asko Kauppi <askok <at> dnainternet.net> writes:
>
>> Some weeks ago, I had a hard disk problem that basically wiped out my
>> accounting software (last Windows application I was using). About
>> time.
>>
>> 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
>> personal finances.
>>
>> 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
(Continue reading)

René Rebe | 8 Sep 12:35
Favicon

Re: Accounting with Lua

David Kastrup wrote:
> Asko Kauppi <askok <at> dnainternet.net> writes:
>
>   
>> Some weeks ago, I had a hard disk problem that basically wiped out my
>> accounting software (last Windows application I was using). About
>> time.
>>
>> 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
>> personal finances.
>>
>> 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 ...

Yours,
(Continue reading)

Alex Davies | 8 Sep 12:47
Favicon

Re: Accounting with Lua

René Rebe wrote:
> And this also only up to 2^32, ... which is why spread-sheet apps and 
> other
> serious accounting stuff uses bignum libraries ...

Closer to 2^53 I believe, unless you're running Lua on your mobile phone to 
do accounting with.

Which should allow you to easily store even America's GDP in cents.

- Alex 

David Kastrup | 8 Sep 13:29

Re: Accounting with Lua

René Rebe <rene <at> exactcode.de> writes:

> David Kastrup wrote:
>> Asko Kauppi <askok <at> dnainternet.net> writes:
>>
>>   
>>> Some weeks ago, I had a hard disk problem that basically wiped out my
>>> accounting software (last Windows application I was using). About
>>> time.
>>>
>>> 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
>>> personal finances.
>>>
>>> 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,

(Continue reading)

Andrew Wilson | 8 Sep 16:03

Re: Accounting with Lua

I've been futzing with a simple checkbook app, since no good, basic,
simple checkbook app seems to exist. Lua & IUP script.  Andrew

On Sun, Sep 7, 2008 at 2:20 PM, Asko Kauppi <askok <at> dnainternet.net> wrote:
>
> Some weeks ago, I had a hard disk problem that basically wiped out my
> accounting software (last Windows application I was using). About time.
>
> 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 personal
> finances.
>
> 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.
>
> -asko
>
>

Gmane