Open
Description
⚙ Compilation target
ES2022
⚙ Library
ES2023
Missing / Incorrect Definition
Intl.NumberFormatPartTypeRegistry
doesn't include "approximatelySign" in it
Sample Code
const nf = new Intl.NumberFormat("en-US", {
style: "currency",
currency: "EUR",
maximumFractionDigits: 0,
});
nf
.formatRangeToParts(value.from, value.to)
.filter((part) => part.type !== "approximatelySign")
.map((part) => part.value)
.join("");
Documentation Link
Here states that "approximately equals" sign is added when range rounds up to the same value
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange#using_formatrange