mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-11-13 12:23:44 +01:00
A consolidated total on the Net Worth page was a single number: it said what everything is worth in one currency, but not how much of it each currency makes up, which is what you want to know when you hold the same money in several currencies (or in currencies standing for gold, stocks or crypto). calculate_currency_totals now keeps, next to each consolidated total, the components it was built from: the currency's own total and the exchanged total of every currency that exchanges into it, all in the consolidated currency. calculate_consolidated_shares gives each of them its share of the total as a percentage, drops the ones that add nothing and sorts the rest from largest to smallest. Shares are taken over the absolute total, so a currency that adds to it always has a positive share and one that takes from it (debt) a negative one; with a zero total there's no share. Currencies that hide their exchanged amounts still show up, since they still count towards the consolidated total, and so do exchange targets that only exist through the deep search. On the Net Worth page, each Consolidated row now lists its components with their share and amount in the consolidated currency. Clicking one shows that currency's line on the charts, like the currency rows above.