'use strict';

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;
