You can say "%(clear_commodity(amount))"

On Sunday, February 6, 2022 at 4:29:24 PM UTC-8 Martin Michlmayr wrote:

> * Sim Tov <[email protected]> [2022-02-06 12:43]:
> > I would like to use the output of `ledger balance ...` in a bash script. 
> I 
> > want to get a number/amount only, without all the strings around it... 
> is 
> > there a command line option to get amount only (even without 
> > commodity/currency sign)?
>
> This gets you the amount (with the commodity):
>
> ledger bal assets:cash --balance-format "%(amount)"
>
> I'm not sure if you can get just the number, but you can just run this
> command through sed or perl to remove the commodity.
>
> -- 
> Martin Michlmayr
> https://www.cyrius.com/
>

-- 

--- 
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/0a0ae737-d2ce-45d5-9bfe-d549f80098f4n%40googlegroups.com.

Reply via email to