format: Is there a way to compare 2 strings; e.g., strcmp.

32 views
Skip to first unread message

Keith David Bershatsky

unread,
Dec 21, 2020, 2:57:28 PM12/21/20
to Ledger
I am in the process of customizing the formatting for some of the reports that I will be using daily, and it sure would be handy if I could format certain areas differently based upon the value of partial_account.  I am assuming that the value for partial_account changes with each account that ultimately gets displayed.  In the format string, it would be handy to do something like:

(strcmp (partial_account, \"XYZ\") ? ABC : DEF)

Is there a way to achieve this?

Stack Overflow

unread,
Dec 22, 2020, 3:54:39 PM12/22/20
to Ledger
SOLVED:   We can use `==` to test for equality of strings in the context of format.
Reply all
Reply to author
Forward
0 new messages