@hhgtech/hhg-components
Version:
Hello Health Group common components
19 lines (15 loc) • 511 B
JavaScript
;
var constantsSite = require('./constantsSite.js');
function isDefined(argument) {
return argument !== undefined && argument !== null;
}
function currencyFormat(x, locale, currency) {
if (!x || !locale)
return `0 ${constantsSite.COUNTRY_CURRENCY_SYMBOL['vi-VN'] || ''}`;
return new Intl.NumberFormat(locale, {
style: 'currency',
currency: currency,
}).format(Number(x));
}
exports.currencyFormat = currencyFormat;
exports.isDefined = isDefined;