This works for a while:
C 1.00000000 BTC = 100,000,000 SAT
C 1.00 bit = 100 SAT
C 1.00000000 BTC = 1,000,000.00 bit
But then the ledger-cli made a mess of commodity conversions. Even if I use the option --exchange BRL if I put this equivalence lines the ledger-cli just ignores the conversion price I put.
Take this file as an example:
P 2021-09-01 00:00:00 BTC 256103,91738800 R$
2021-09-17 * Opening Balance
My Wallet 1,00000000 BTC
Equity:Opening Balances
When I run:
ledger -f draft.ledger bal --exchange=R$
I get the expected result:
R$-256104 Equity:Opening Balances
R$256104 My Wallet
--------------------
0
But if I add the equivalence of the commodity BTC, as follow:
C 1.00000000 BTC = 100,000,000 SAT
C 1.00 bit = 100 SAT
C 1.00000000 BTC = 1,000,000.00 bit
P 2021-09-01 00:00:00 BTC 256103,91738800 R$
2021-09-17 * Opening Balance
My Wallet 1,00000000 BTC
Equity:Opening Balances
The result of:
ledger -f draft.ledger bal --exchange=R$
is surprisingly:
-1,00000000 BTC Equity:Opening Balances
1,00000000 BTC My Wallet
--------------------
0
The ledger-cli starts to ignore the conversion.
It seems a bug behavior.