import { memoize } from "@platform-modules/util/memo";
//#region src/format.ts
const _nf = memoize((locale, options) => new Intl.NumberFormat(locale, options));
const _dtf = memoize((locale, options) => new Intl.DateTimeFormat(locale, options));
function formatNumber(locale, value, options) {
	return _nf(locale, options).format(value);
}
function formatDate(locale, value, options) {
	return _dtf(locale, options).format(value);
}
function formatCurrency(locale, value, currency, options) {
	return _nf(locale, {
		style: "currency",
		...options,
		currency
	}).format(value);
}
//#endregion
export { formatCurrency, formatDate, formatNumber };
