const require_serverContext = require('../serverContext.cjs');
const require_IntlayerServerProvider = require('../IntlayerServerProvider.cjs');
const require_number = require('../../@intlayer/core/dist/esm/formatters/number.cjs');

//#region ../react-intlayer/dist/esm/server/format/useNumber.mjs
/**
* React client hook that provides a localized number formatter.
*
* Uses the current locale from {@link useLocaleBase} and returns
* a function that can be used to format numbers consistently
* according to the user's locale.
*
* @example
* ```tsx
* const formatNumber = useNumber();
*
* formatNumber(12345);
* // e.g. "12,345" (en-US)
* // e.g. "12 345" (fr-FR)
*
* formatNumber(0.75, { style: "percent" });
* // e.g. "75%"
* ```
*
* @returns {(value: string | number, options?: import("../createNumber").NumberProps) => string}
* A number formatting function bound to the active locale.
*/
const useNumber = () => {
	const locale = require_serverContext.getServerContext(require_IntlayerServerProvider.IntlayerServerContext);
	return (...args) => require_number.number(args[0], {
		...args[1],
		locale: args[1]?.locale ?? locale
	});
};

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