all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to avoid floating number problems with org-table for finances?
@ 2012-10-12 17:06 Thomas Koch
  2012-10-12 18:00 ` Johan Sandblom
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Koch @ 2012-10-12 17:06 UTC (permalink / raw)
  To: emacs-orgmode

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(@1..@3);%.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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-01 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12 17:06 how to avoid floating number problems with org-table for finances? Thomas Koch
2012-10-12 18:00 ` Johan Sandblom
2012-10-12 18:04 ` Johan Sandblom
2012-11-01 18:04 ` Michael Brand

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.