UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

31 lines (28 loc) 843 B
import { defineComponent, computed, toDisplayString } from 'vue'; import { formatNumber } from '@zag-js/i18n-utils'; import { useLocaleContext, DEFAULT_LOCALE } from '../../providers/locale/use-locale-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "format-number", props: { value: {}, compactDisplay: {}, notation: {}, signDisplay: {}, unit: {}, unitDisplay: {}, currencyDisplay: {}, currencySign: {} }, setup(__props) { const props = __props; const locale = useLocaleContext(DEFAULT_LOCALE); const text = computed(() => { const { value, ...intlProps } = props; return formatNumber(value, locale.value.locale, intlProps); }); return (_ctx, _cache) => { return toDisplayString(text.value); }; } }); export { _sfc_main as default };