The Intl.NumberFormat for currency PGK, it is showing PGK as narrow symbol instead of K
What can I do to fix this?
I cannot replace the Intl.NumberFormat function and I cannot add additional code after the function is called, I can only change the the arguments.
const number = 123456.789;
console.log(new Intl.NumberFormat('en', { style: 'currency', currency: 'PGK', currencyDisplay: "narrowSymbol", }).format(number));
// Expected output: "K 123.456,79"
// Output: "PGK 123.456,79"
console.log(new Intl.NumberFormat('en', { style: 'currency', currency: 'MMK', currencyDisplay: "narrowSymbol", }).format(number));
// Output: "K 123.456,79"
2
Answers
I ended up overring the function to fix the currencies with a problem.
It doesn’t fully support all world currencies yet, and when it’s not supported it just returns the currency code, for example: (ZQY currency doesn’t even exist):
Some other currencies currently not supported:
["CRC","CUC","CUP","CVE","CZK","DJF","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRO","MUR","MVR","MWK","MYR","MZN","NAD","NGN","NIO","NOK","NPR","OMR","PAB","PEN","PGK","PKR","PLN","TZS","UAH","UGX","UYU","UZS","VEF","VUV","WST","XDR","YER","ZAR","ZMW","ZWD"]