Does anybody use (number, currency) amounts in metadata?

82 views
Skip to first unread message

Martin Blais

unread,
Sep 23, 2021, 4:55:02 PM9/23/21
to Beancount
e.g. 

  2021-01-02 * "Some transaction"
    real_value: 123.45 USD
    ...

Does anyone use an Amount type as a metadata value?
(If I can remove it in the new version it'll simplify grammar.)

Ben Blount

unread,
Sep 23, 2021, 5:03:20 PM9/23/21
to Beancount
I don't, and it seems like it would be fine to have a single valued metadata. I assume the grammar will require the key to be a string, but the values can be dates, bool, ints, floats etc?

If there are folks that rely on this, there's a workaround of breaking it into 2 metadata where knowing the currency is important:
  2021-01-02 * "Some transaction"
    real_value_number: 123.45
    real_value_currency: "USD"

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhOGZwDZAFvmaEQXiV4hmagdwAs6ya1gwQOJCW%3DgKw%2Bzag%40mail.gmail.com.

Patrick Ruckstuhl

unread,
Sep 23, 2021, 5:24:58 PM9/23/21
to Ben Blount, Beancount
Similar here, in my case I use already a string for it, this is only informational so a string is good enough.

redst...@gmail.com

unread,
Sep 23, 2021, 7:24:29 PM9/23/21
to Beancount
Yes, I do, and I have scripting that works with these as well. I won't complain much if it's removed though, and can use a workaround like the one Ben suggested.

Same question as Ben: I assumed the grammar will still allow all remaining datatypes like dates, bool, ints, etc.?

Daniele Nicolodi

unread,
Sep 23, 2021, 8:48:20 PM9/23/21
to bean...@googlegroups.com
I use it a lot. I could live without it, but if I would need to name a
thing related to metadata to get rid off, I would choose the support for
expressions as metadata values.

Does the grammar simplification come from a reduction of the
shift/reduce conflicts or is it something else?

PS: have you seen my email about bean-query or is Gmail having another
bad period with my mailserver?

Cheers,
Dan

Martin Blais

unread,
Sep 23, 2021, 10:26:17 PM9/23/21
to Beancount
On Thu, Sep 23, 2021 at 8:48 PM Daniele Nicolodi <dan...@grinta.net> wrote:
On 23/09/2021 22:54, Martin Blais wrote:
> e.g. 
>
>   2021-01-02 * "Some transaction"
>     real_value: 123.45 USD
>     ...
>
> Does anyone use an Amount type as a metadata value?
> (If I can remove it in the new version it'll simplify grammar.)

I use it a lot. I could live without it, but if I would need to name a
thing related to metadata to get rid off, I would choose the support for
expressions as metadata values.

Thanks everyone, I'll try to keep it in the syntax, all the feedback is useful.


Does the grammar simplification come from a reduction of the 
shift/reduce conflicts or is it something else?

Yes, one of those.
I'll find a way.
 

PS: have you seen my email about bean-query or is Gmail having another
bad period with my mailserver?

I have it, that inbox is a jungle my friend, trying to prioritize, i'll respond eventually.

 

Cheers,
Dan


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

James Cook

unread,
Sep 23, 2021, 11:41:16 PM9/23/21
to bean...@googlegroups.com
I use it a bit with plugins I wrote, but could switch to a workaround
if needed.

--
James

Martin Michlmayr

unread,
Sep 24, 2021, 4:55:10 AM9/24/21
to bean...@googlegroups.com
* Martin Blais <bl...@furius.ca> [2021-09-23 16:54]:
> Does anyone use an Amount type as a metadata value?

I use that feature for a non-profit. Our books are in USD but some
payments are in other currencies via Wise and I use meta-data to track
that and run some checks.

--
Martin Michlmayr
https://www.cyrius.com/

Martin Blais

unread,
Sep 24, 2021, 10:24:00 AM9/24/21
to Beancount
Got it, I've managed to make it work and will keep it.


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages