import { formatPrice } from "../src/utilitiesPrice"; const price = 123456.789012; const lang = "en-US"; const currency = "SEK"; test("price rounding 0", () => { expect(formatPrice(price, 0, lang, currency)).toBe("SEK\u00A0123,457"); }); test("price rounding 2", () => { expect(formatPrice(price, 2, lang, currency)).toBe("SEK\u00A0123,456.79"); }); test("price rounding -1", () => { expect(formatPrice(price, -1, lang, currency)).toBe("SEK\u00A0123,460"); }); test("price rounding -2", () => { expect(formatPrice(price, -2, lang, currency)).toBe("SEK\u00A0123,500"); });