import Vue from 'vue';
import { MONEY_NAME } from '../filter-names';
export function formatCurrency(money, currency) {
    return formatCurrencyWithOptions(money, { currency: currency });
}
export function formatCurrencyWithOptions(money, options) {
    if ((!isNaN(money) && money) || money === 0) {
        var stripDecimalZeroes = Number.isInteger(money) && !!options.stripDecimalZeroes;
        return money.toLocaleString(Vue.prototype.$i18n.getCurrentLocale(), {
            style: 'currency',
            currency: options.currency,
            minimumFractionDigits: stripDecimalZeroes ? 0 : undefined,
            maximumFractionDigits: stripDecimalZeroes ? 0 : undefined
        });
    }
    else {
        return '';
    }
}
var MoneyPlugin = {
    install: function (v) {
        v.filter(MONEY_NAME, formatCurrency);
    }
};
export default MoneyPlugin;
//# sourceMappingURL=money.js.map