X Enterprises
Data

DataNumber

Inline number formatted via Intl.NumberFormat with sign, prefix, suffix, and colorize support.

Data

Data components handle the rendering of structured information in detail views, sidebars, and list pages. They cover everything from a single formatted number to a full activity feed with date grouping.

Components

<XADataNumber />

Renders a single number as an inline <span> using Intl.NumberFormat. Supports decimal, percent, and unit styles; compact notation; and optional color styling for positive/negative values.

<!-- Currency compact -->
<XADataNumber :value="1248000" format="decimal" notation="compact" compact-display="short" />
<!-- Result: 1.2M -->

<!-- Percent with sign coloring -->
<XADataNumber :value="-4.2" format="percent" show-sign colorize />

<!-- Unit -->
<XADataNumber :value="128" format="unit" unit="gigabyte" unit-display="short" />

Props

PropTypeDefaultDescription
valuenumber | stringnullThe numeric value to format.
localestring'en-US'Intl locale string.
format'decimal' | 'percent' | 'unit''decimal'Intl number style.
unitstring''Unit identifier (e.g. 'gigabyte'). Only used when format is 'unit'.
unitDisplay'short' | 'long' | 'narrow''short'Unit display style.
notation'standard' | 'scientific' | 'engineering' | 'compact''standard'Number notation.
compactDisplay'short' | 'long''short'Compact display style (used with notation: 'compact').
minimumFractionDigitsnumber0Minimum decimal places.
maximumFractionDigitsnumber2Maximum decimal places.
showSignbooleanfalseAlways show + or sign.
colorizebooleanfalseApply green/red color class for positive/negative values.
prefixstring''Text prepended to the formatted output.
suffixstring''Text appended to the formatted output.

AI Context

component: XADataNumber
package: "@xenterprises/nuxt-x-app"
auto-import: true
prefix: XA
category: Data
use-when: Rendering a single formatted number inline. Handles decimal, percent, and unit formats; compact notation; sign display; and positive/negative colorization.
Copyright © 2026