refactor!: support RUB only (WealthLedger/main#55) (#168)
This commit was merged in pull request #168.
This commit is contained in:
@@ -43,7 +43,6 @@ 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 $");
|
||||
expect(formatMoney({ currency: "RUB", value: "0001234.50" })).toBe(
|
||||
"0 001 234,50 ₽",
|
||||
);
|
||||
@@ -71,14 +70,11 @@ describe("shared display helpers", () => {
|
||||
)).toBe("0,00 ₽");
|
||||
});
|
||||
|
||||
it("rounds to the currency's minor units and drops the sign of a rounded zero", () => {
|
||||
it("rounds to minor units and drops the sign of a rounded zero", () => {
|
||||
const rounded = { withRoundedCents: true };
|
||||
expect(formatMoney({ currency: "RUB", value: "-0.004" }, rounded)).toBe("0,00 ₽");
|
||||
expect(formatMoney({ currency: "RUB", value: "-0.005" }, rounded)).toBe("-0,01 ₽");
|
||||
expect(formatMoney({ currency: "RUB", value: "999.995" }, rounded)).toBe("1 000,00 ₽");
|
||||
expect(formatMoney({ currency: "JPY", value: "1500.5" }, rounded)).toBe("1 501 JPY");
|
||||
expect(formatMoney({ currency: "KWD", value: "1.2345" }, rounded)).toBe("1,235 KWD");
|
||||
expect(formatMoney({ currency: "ZZZ", value: "1.234" }, rounded)).toBe("1,23 ZZZ");
|
||||
});
|
||||
|
||||
it("builds the brand logo url from an upstream file name", () => {
|
||||
|
||||
Reference in New Issue
Block a user