I am trying to use Intl as a default currency formatter and it is almost perfect.
Using the example from a Intl.NumberFormat() constructor:
const number = 123456.789;
console.log(new Intl.NumberFormat('de-DE', { style: 'currency',
currency: 'EUR' }).format(number)); // expected output: "123.456,79 €"
// the Japanese yen doesn't use a minor unit
console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY'
}).format(number)); // expected output: "¥123,457"
This is almost perfect but I would actually like to drop the symbol from the output. So I would expect to see:
// expected output: "123.456,79"
// expected output: "123,457"
I find it bizarre that I spend over an hour looking for a solution and only found some sort of replace/trim usage.
Why there is not an option to format the number with all the Intl power but only dropping the currency symbol?!?
I hope I missed it, tbh.