You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes a commodity has several forms which are all equivalent. An
example of this is time. Whether tracked in terms of minutes, hours or days,
it should be possible to convert between the various forms. Doing this
requires the use of commodity equivalences.
For example, you might have the following two postings, one which transfers
an hour of time into a 'Billable' account, and another which decreases the
same account by ten minutes. The resulting report will indicate that
fifty minutes remain:
2005/10/01 Work done for company
Billable:Client 1h
Project:XYZ
2005/10/02 Return ten minutes to the project
Project:XYZ 10m
Billable:Client
Reporting the balance for this ledger file produces:
Defining other equivalences should be simple. The following is an example that
creates commodity equivalences, helpful for tracking bytes, kilobytes,
megabytes, and more:
C 1.00 Kb = 1024 b
C 1.00 Mb = 1024 Kb
C 1.00 Gb = 1024 Mb
C 1.00 Tb = 1024 Gb
Equivalence chains can be as long as desired. While rendering the commodity,
as text, it would report as a decimal amount (less than 1.00), the next
smallest commodity is used. If a commodity could be reported in terms of a
higher commodity without resulting to a partial fraction, then the larger
commodity is used.
Can be considered after implementing #4
Sometimes a commodity has several forms which are all equivalent. An
example of this is time. Whether tracked in terms of minutes, hours or days,
it should be possible to convert between the various forms. Doing this
requires the use of commodity equivalences.
For example, you might have the following two postings, one which transfers
an hour of time into a 'Billable' account, and another which decreases the
same account by ten minutes. The resulting report will indicate that
fifty minutes remain:
Reporting the balance for this ledger file produces:
Defining other equivalences should be simple. The following is an example that
creates commodity equivalences, helpful for tracking bytes, kilobytes,
megabytes, and more:
Equivalence chains can be as long as desired. While rendering the commodity,
as text, it would report as a decimal amount (less than
1.00
), the nextsmallest commodity is used. If a commodity could be reported in terms of a
higher commodity without resulting to a partial fraction, then the larger
commodity is used.
Refer: ledger-cli:commodity-equivalence
The text was updated successfully, but these errors were encountered: