I've had a similar problem and added the following to my .ledgerrc

--balance-format %(justify(scrub(display_total), 20, -1, true, color))
> %(!options.flat ? depth_spacer :
> '')%-(ansify_if(partial_account(options.flat), cyan if
> color))\n%/%$1\n%/--------------------\n
>

The only difference here is that I print out the value of each account
before the name of each account (I did this because I have some long
account names). You could probably start with this and edit it to suit your
needs. The justify command is how I align the display_total values printed
to the terminal. Also, if you don't like the cyan color feel free to swap
it with any other terminal text color (I used cyan because the default dark
blue text for the account names doesn't provide enough contrast on a black
terminal).



On Mon, Jul 20, 2020 at 2:48 PM James <[email protected]> wrote:

> Yes. Absolutely,
> The desired output is like in the Ledger manual example:-
>
> https://imgur.com/a/hhJjDrd
>
> When I try doing this on my machine the display totals(and percent values)
> are messy. They are not straight but rather squiggly. I think it has to do
> something with the formatting commands.
>
> Current Output :
>
>  Food 10.00 USD
>   Water 5.00 USD
>   Egg 2.00 USD
>   Cheese 3.00 USD
>
>
>
> Desired Output :
>
>  Food           10.00 USD
>   Water          5.00 USD
>   Egg              2.00 USD
>   Cheese       3.00 USD
>
>
>
>
>
>
> On Tuesday, July 21, 2020 at 1:25:50 AM UTC+7 Sam Tetruashvili wrote:
>
>> Can you provide an example of your desired output?
>>
>> On Mon, Jul 20, 2020 at 2:00 PM James <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I am struggling with ledger formatting. I am trying to get the total
>>> amount in a straight line.
>>>
>>> --format "\ %((depth_spacer)+(partial_account))\  %(display_total)\n%/"
>>>
>>>
>>> I am not very good with the formatting and would appreciate if someone
>>> could help with the above so that the display_total is indented (and in a
>>> straight line).
>>>
>>> Thanks !
>>>
>>> --
>>>
>>> ---
>>> 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/655787e0-e603-4413-8691-71133e21a84co%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ledger-cli/655787e0-e603-4413-8691-71133e21a84co%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>
> ---
> 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/69f17883-bee4-432e-96cc-642435b62a5an%40googlegroups.com
> <https://groups.google.com/d/msgid/ledger-cli/69f17883-bee4-432e-96cc-642435b62a5an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 

--- 
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/CADac%3DjdN%2B%2Bdun5BJ7rymx9toN1jfn9yWVyybrPdEcceHDwge%3DQ%40mail.gmail.com.

Reply via email to