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