Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Number Format

Displays a number, price or percentage formatted for a locale by the browser's Intl.NumberFormat.

ComponentsNumber Format
typographystatic
<arc-number-format>

Overview

Number Format renders a number formatted by the browser's `Intl.NumberFormat`. Pass a raw `value` and a `type` (`number`, `currency`, `percent` or `compact`), and it adds thousands separators, currency symbols, percent signs or compact suffixes like "12.3K" and "1.2M". It sets `font-variant-numeric: tabular-nums` and the monospace font, so numbers line up in tables, stat grids and dashboards. The `locale` prop takes a BCP 47 tag, and `Intl.NumberFormat` applies that locale's conventions: with `de-DE`, 1234.5 shows as "1.234,5". Without it, the locale is `en-US`. For the `percent` type, pass the percentage itself: `50` displays "50%". Plain `Intl.NumberFormat` multiplies by 100, so it would want `0.5`.

Guidelines

Do

  • Use it in tables and stat cards where numbers need to line up
  • Set `type="currency"` and a `currency` code for money
  • Use `notation="compact"` for large numbers in tight layouts
  • Set `locale` in multi-language apps

Don't

  • Don't use it for animated counting. Use Animated Number
  • Don't add your own monospace styling. It already sets the mono font and tabular-nums
  • Don't leave out `currency` with `type="currency"` unless you mean USD

Features

  • `decimals` sets decimal places, 0 to 20. Unset, it's 0 for numbers, 2 for currency and 1 for percent
  • `currency` takes an ISO 4217 code and defaults to USD
  • Inherits size and color from its parent

Preview

Number:
Currency:
Percent:
Compact:

Usage

<!-- Basic number with thousands separators -->
<arc-number-format value="1234567"></arc-number-format>

<!-- Currency -->
<arc-number-format value="1234.50" type="currency" currency="USD"></arc-number-format>

<!-- Percentage (50 = 50%) -->
<arc-number-format value="99.9" type="percent"></arc-number-format>

<!-- Compact notation -->
<arc-number-format value="1234567" notation="compact"></arc-number-format>

<!-- European locale -->
<arc-number-format value="1234.56" type="currency" currency="EUR" locale="de-DE"></arc-number-format>

API

localestring'en-US'
BCP 47 locale tag for locale-aware formatting
currencystring'USD'
ISO 4217 currency code, used when type is "currency"
valuenumber0
The number to format
type'number' | 'currency' | 'percent' | 'compact''number'
Formatting style to apply
decimalsnumber0
Number of decimal places, 0 to 20 (Intl.NumberFormat's own range). Unset uses a per-format default: 0 for number, 2 for currency, 1 for percent.
notation'standard' | 'compact''standard'
Number notation: compact gives "12.3K", "1.2M"

See also