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 };
