preskok/ui

Number Format

Format numbers and currencies consistently using a context-aware component.

Installation

pnpm dlx @preskok-org/ui@latest add number-format

Usage

import {
  NumberFormatProvider,
  NumberText,
  useNumberFormat,
} from "@/registry/preskok/ui/preskok-ui/number-format/number-format"
 
export function NumberFormatDemo() {
  return (
    <NumberFormatProvider locale="en-US" currency="USD">
      <NumberText value={12345.67} />
    </NumberFormatProvider>
  )
}