emacs-orgmode
[Top][All Lists]

## Re: org-tables with monetary amounts

 From: Daniele Nicolodi Subject: Re: org-tables with monetary amounts Date: Fri, 9 Oct 2020 18:14:08 +0200 User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.1

```Hello Christian,

thank you for your input. calc support for units indeed covers the
basics of working with currencies. I gave it a spin on some notes I have
been working on recently. While some things work very nicely, other are
a bit ugly. It is a good start and I'll explore this approach more.

On 24/09/2020 11:17, Christian Moe wrote:

> Now, with the Calc command to simplify units, you can add dollars to
> euros and get the result in whichever currency comes first in the
> algebraic expression
>
>   | 3 USD | 4 EUR | 6.58 EUR |
>   #+tblfm: \$3=usimplify(\$2+\$1)
>
>   | 3 USD | 4 EUR | 7.6511628 USD |
>   #+tblfm: \$3=usimplify(\$1+\$2)

Having to explicitly use usimplify() is a bit too verbose. It would be
ideal if this could be somehow be implicit.

> I don't use this functionality, so I don't have answers to all the
> questions you'll now have -- including how to get the desired precision
> without lopping off the currency unit in the last example!

Having the desired fixed precision is quite important for this to be
useful. In y recent tests I had to drop the units (currencies) to
achieve this. It would be nice to find a way to avoid it.

> There are ways to enter user-defined units permanently. But exchange
> rates change, so to use this functionality on a daily basis, you'll want
> to have some kind of function to pull exchange rates and update the
> currency unit definitions in the Calc init file.

Computations usually refer to a specific point in time, thus this is npt
a big problem in practice. I already have scripts to pull exchange rates
at a given date. These can the be inserted as a property that can be
easily references from the computations.

> Apart from `usimplify', most Calc functions on units appear (?) to be
> missing corresponding algebraic versions that you can use in Calc
> expressions in Org tables, which limits the usefulness.
>
> Org tables don't seem to have any specific formula syntax for leveraging
> Calc unit operations apart from what happens to work out of the
> box. This might be an area for improvement, though I'm not sure what to

I don't understand what you mean in the two paragraphs above. Can you