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/compact.mjs
/**
* Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)
* based on locale and formatting options.
*
* @example
* compact({ value: 1200 }); // "1.2K"
*
* @example
* compact({ value: "1000000", locale: Locales.FRENCH, compactDisplay: "long" });
* // "1 million"
*/
const compact = (value, options) => new CachedIntl.NumberFormat(options?.locale ?? built_default?.internationalization?.defaultLocale, {
	...options,
	notation: "compact"
}).format(Number(value));

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