Skip to content

Commit

Permalink
test(currency): add case for lang/locale pair without explicit symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
kspeyanski committed Dec 21, 2023
1 parent 8e354e4 commit c50c555
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/numbers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ const numbers = require("cldr-numbers-full/main/bg/numbers.json");
const currencies = require("cldr-numbers-full/main/bg/currencies.json");
const currencyData = require("cldr-core/supplemental/currencyData.json");

load(likelySubtags, currencyData, numbers, currencies);
const localNumbers = require("cldr-numbers-full/main/de-CH/numbers.json");
const localCurrencies = require("cldr-numbers-full/main/de-CH/currencies.json");

load(likelySubtags, currencyData, numbers, currencies, localNumbers, localCurrencies);

function loadCustom(options) {
load({
Expand Down Expand Up @@ -300,6 +303,10 @@ describe('standard currency formatting', () => {
expect(formatNumber(10, "c", "bg-BG")).toEqual("10,00 лв.");
});

it("should apply format when passing language and territory without symbol", () => {
expect(formatNumber(10, "c", "de-CH")).toEqual("CHF 10.00");
});

it("should apply format when passing object", () => {
expect(formatNumber(10, { style: "currency" })).toEqual("$10.00");
});
Expand Down

0 comments on commit c50c555

Please sign in to comment.