emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-tables with monetary amounts


From: Neil Jerram
Subject: Re: org-tables with monetary amounts
Date: Fri, 25 Sep 2020 10:25:31 +0100

On Tue, 22 Sep 2020 at 17:05, Daniele Nicolodi <daniele@grinta.net> wrote:
Hello,

Hi Daniele...
 

I often use org-tables to work with monetary amounts.

Me too.  I use Org mode plus Scheme code to try to analyze my bank statements and compare them against a budget.  Org is a convenient form for specifying the inputs - e.g. the names of OFX files to read, and string matches for how I want to categorize the transactions - and for displaying the results.

Aside: Perhaps I'm misunderstanding them, but none of the open source tools, including (h)ledger, seem to be of much help here.
- They focus on data entry and reconciliation, which I don't need as I'm happy to download and use OFX files from my bank.
- They don't offer anything intelligent and automated for automatically categorizing transactions.
- They don't have a sophisticated representation of a budget, and reporting against that.
Do you know of a good forum (other than this!) for discussing such points?
 
It would be very
nice to have a couple of functionalities common in this domain:

- fixed precision arithmetic, namely derive the precision of the results
from the precision of the arguments (I think that calc can do this),

In my Scheme code, I convert between strings and pence:

    ;; In this file, an amount at rest is always represented as a string
    ;; with 2 decimal places.  Convert from that to an integer number of
    ;; pence:

    (define (amount->pence amount)
      (inexact->exact (round (* 100 (string->number amount)))))

    ;; And the reverse:

    (define (pence->amount pence)
      (format-2dp (/ (exact->inexact pence) 100)))
 

- support for parsing numbers followed by currencies,

- correct alignment for monetary values.

I had a quick look around, but I haven't found anything that implements
those things. Has anyone some secret code that they would like to share?

I've attached mine, in case you read Scheme and there's more detail in there that is of interest.

Best wishes,
    Neil


Attachment: nationwide.scm
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]