phx-react
Version:
PHX REACT
19 lines • 771 B
JavaScript
;
exports.__esModule = true;
exports.formatNumber = exports.toVND = void 0;
var tslib_1 = require("tslib");
var formatNumber = function (number, locale, option) {
var _a;
return new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : 'VND', tslib_1.__assign(tslib_1.__assign({}, option), { currency: (_a = option === null || option === void 0 ? void 0 : option.currency) !== null && _a !== void 0 ? _a : 'VND' })).format(number);
};
exports.formatNumber = formatNumber;
function toVND(n) {
return new Intl.NumberFormat('vi-VN', {
style: 'currency',
currency: 'VND',
minimumFractionDigits: 0,
maximumFractionDigits: 4
}).format(n);
}
exports.toVND = toVND;
//# sourceMappingURL=format-number.js.map