fix: polish accounts portfolio summary (#159)
Frontend verify / commits (push) Skipped
Frontend verify / security (push) Successful in 10s
Frontend verify / verify (push) Failing after 7m26s

This commit was merged in pull request #160.
This commit is contained in:
2026-11-06 15:17:27 +03:00
parent 2fd7d59e65
commit 134c951178
13 changed files with 146 additions and 101 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ describe("shared display helpers", () => {
"-1 234 567,89 ₽",
);
expect(formatMoney({ currency: "RUB", value: "10" })).toBe("10 ₽");
expect(formatMoney({ currency: "USD", value: "0.5" })).toBe("0,5 USD");
expect(formatMoney({ currency: "USD", value: "0.5" })).toBe("0,5 $");
expect(formatMoney({ currency: "RUB", value: "0001234.50" })).toBe(
"0 001 234,50 ₽",
);
+4 -1
View File
@@ -86,7 +86,10 @@ function formatMoney(
? `${integerPart}.${normalizedFraction}`
: integerPart;
const currency = money.currency === "RUB" ? "₽" : money.currency;
let currency = money.currency;
if (currency === "RUB") currency = "₽";
else if (currency === "USD") currency = "$";
const formatted = `${formatDecimal(decimal)} ${currency}`;
if (!withSign) return formatted;