File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,18 @@ void budget::assets_card(budget::html_writer& w) {
4848
4949 if (group_style) {
5050 std::vector<std::string> groups;
51+ std::unordered_map<std::string, budget::money> group_sums;
5152
5253 for (const auto & [asset, amount] : w.cache .user_assets () | expand_value (w.cache ) | not_zero) {
5354 std::string group = asset.name .substr (0 , asset.name .find (separator));
5455
5556 if (!std::ranges::contains (groups, group)) {
5657 groups.emplace_back (std::move (group));
5758 }
59+
60+ if (amount) {
61+ group_sums[group] += amount * exchange_rate (asset.currency , budget::local_day ());
62+ }
5863 }
5964
6065 for (const auto & group : groups) {
@@ -66,7 +71,7 @@ void budget::assets_card(budget::html_writer& w) {
6671
6772 if (!started) {
6873 w << " <div class=\" asset_group\" >" ;
69- w << group;
74+ w << group << " ( " << group_sums[group] << " " << get_default_currency () << " ) " ;
7075 w << " </div>" ;
7176
7277 started = true ;
You can’t perform that action at this time.
0 commit comments