const require_built = require('../config/dist/esm/built.cjs');
const require_intl = require('../utils/intl.cjs');

//#region ../react-intlayer/dist/esm/@intlayer/core/dist/esm/formatters/currency.mjs
/**
* Formats a numeric or string value into a localized currency string using the Intl API.
*
*  @example
* currency({ value: 1234.5, currency: 'EUR' });
* // "€1,234.50"
*
* @example
* currency({ value: "5000", locale: Locales.FRENCH, currency: "CAD", currencyDisplay: "code" });
* // "5 000,00 CAD"
*/
const currency = (value, options) => new require_intl.CachedIntl.NumberFormat(options?.locale ?? require_built.built_default?.internationalization?.defaultLocale, {
	style: "currency",
	currency: options?.currency ?? "USD",
	currencyDisplay: options?.currencyDisplay ?? "symbol",
	minimumFractionDigits: options?.minimumFractionDigits ?? 2,
	maximumFractionDigits: options?.maximumFractionDigits ?? 2,
	...options
}).format(Number(value));

//#endregion
exports.currency = currency;
//# sourceMappingURL=currency.cjs.map