"use client"
import {
NumberFormatProvider,
NumberText,
} from "@/components/ui/preskok-ui/number-format/number-format"
export function NumberFormatPreskokDemo() {
return (
<NumberFormatProvider>
<div className="space-y-2">
<NumberText value={12345.67} />
<NumberText value={0.1234} intlOptions={{ style: "percent" }} />
</div>
</NumberFormatProvider>
)
}
Installation
CLI
Manual
pnpmnpmyarnbunpnpm 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>
)
}