import { built_default } from "../config/dist/esm/built.mjs";
import { CachedIntl } from "../utils/intl.mjs";

//#region ../react-intlayer/dist/esm/@intlayer/core/dist/esm/formatters/percentage.mjs
/**
* Formats a number as a percentage string (e.g., 0.25 → "25%").
*
* @example
* percentage({ value: 0.25 }) // "25%"
* percentage({ value: 0.25, minimumFractionDigits: 2 }) // "25.00%"
*/
const percentage = (value, options) => {
	let numericValue = Number(value);
	if (numericValue > 1) numericValue /= 100;
	return new CachedIntl.NumberFormat(options?.locale ?? built_default?.internationalization?.defaultLocale, {
		style: "percent",
		...options
	}).format(Number(numericValue));
};

//#endregion
export { percentage };
//# sourceMappingURL=percentage.mjs.map