- Format a valid string or number to any currency.
const formatAsMoney = (amount, locale = "en-NG", currency = "NGN") => {
return new Intl.NumberFormat(locale, {
style: "currency",
currency,
}).format(amount);
};
- Working with URL query strings made easy -> docs
- more coming...