Ah, these are great. Thanks!

On Thu, Jun 8, 2023 at 1:53 PM Alexis <[email protected]> wrote:

> Hello Viraj,
>
> I know of two options to reduce the duplication of the amount value:
>
> 1. Using transaction typed metadata
>
>   2023/06/06 McDonalds
>       ; amount_spent:: $23.98
>       Expenses:Food:Restaurants                    (tag("amount_spent"))
>       Liabilities:Apple Card                      (-tag("amount_spent"))
>       Income:Credit Card Rewards         (-(tag("amount_spent")) * 0.02)
>       Assets:Apple Cash
>
>   See https://ledger-cli.org/doc/ledger3.html#Typed-metadata
>
>
> 2. Using a define
>
>   define spent_amount=$23.98
>   2023/06/06 McDonalds
>       Expenses:Food:Restaurants                           (spent_amount)
>       Liabilities:Apple Card                             (-spent_amount)
>       Income:Credit Card Rewards                (-(spent_amount) * 0.02)
>       Assets:Apple Cash
>
>   See https://ledger-cli.org/doc/ledger3.html#index-define
>
>
> Hope this helps,
> Alexis
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Ledger" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ledger-cli/tqXZGjJbZSo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ledger-cli/ty4szlg6plx7c4ty4ixuf6gohf4hyx4yjqnpct4xeetpkj5rcs%40fgfvyi2zrlm5
> .
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAM502dOfEXP6yPO81stTxHW-yRvia6KdeHopA--ZxG6itkFwOQ%40mail.gmail.com.

Reply via email to