@hhgtech/hhg-components
Version:
Hello Health Group common components
16 lines (13 loc) • 469 B
JavaScript
import { COUNTRY_CURRENCY_SYMBOL } from './constantsSite.js';
function isDefined(argument) {
return argument !== undefined && argument !== null;
}
function currencyFormat(x, locale, currency) {
if (!x || !locale)
return `0 ${COUNTRY_CURRENCY_SYMBOL['vi-VN'] || ''}`;
return new Intl.NumberFormat(locale, {
style: 'currency',
currency: currency,
}).format(Number(x));
}
export { currencyFormat as c, isDefined as i };