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/units.mjs
/**
* Formats a numeric value as a localized unit string.
*
* @example
* units({ value: 5, unit: "kilometer", unitDisplay: "long", locale: "en-GB" })
* // "5 kilometers"
*/
const units = (value, options) => new CachedIntl.NumberFormat(options?.locale ?? built_default?.internationalization?.defaultLocale, {
	style: "unit",
	unit: options?.unit ?? "day",
	unitDisplay: options?.unitDisplay ?? "short",
	useGrouping: options?.useGrouping ?? false
}).format(Number(value));

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