[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] how to avoid floating number problems with org-table for finances?
From: |
Thomas Koch |
Subject: |
[O] how to avoid floating number problems with org-table for finances? |
Date: |
Fri, 12 Oct 2012 19:06:59 +0200 |
User-agent: |
KMail/1.13.7 (Linux/3.5-trunk-amd64; KDE/4.8.4; x86_64; ; ) |
Hi,
I use a simple org-mode table to sum up the expenses and incomes of a small
private project. Now I remembered that I should know as a programmer to NEVER
EVER USE FLOATS FOR FINANCES!!!
But I did...
| 0.3 |
| 0.3 |
| 0.3 |
| 0.9000000000000000222044604925031308084726 |
#+TBLFM: @4$1=vsum(@address@hidden);%.40f
Do you know any quirck how I can continue using point notation but be sure
that the numbers are added correctly? I think I'd need another vsum method
that would
- find the number of decimal points of the most precise field
- parse all numbers to integers by filling up zeros at the end and ignoring
the decimal point
- sum up
- write the result with a decimal point at the right position
Best regards,
Thomas Koch, http://www.koch.ro
- [O] how to avoid floating number problems with org-table for finances?,
Thomas Koch <=