Precise Number

Precise Number is a copy-paste React component that stops ₹1.24 cr rounded up to ₹1.3 cr before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/precise-number
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 3 extra npm packages
  • A11y guidance in docs

Stops₹1.24 Cr rounded up to ₹1.3 Cr

Was this component page useful?

How do I install Precise Number?

pnpm dlx shadcn@latest add @bollard/precise-number

The files land in your project. They're yours to edit.

How do I use Precise Number in React?

precise-number-usage.tsx
import { PreciseNumber } from "@/components/ui/precise-number"

{ label: "Annual revenue", node: <PreciseNumber value={123456789} currency="INR" toggleable />

What input mistakes does Precise Number catch?

  • ₹99,99,999 shown as ₹1 Cr: it reads ₹99.9 L instead
  • Exact value hidden: tooltip on hover or focus
  • Lakh/crore vs million confusion, with a toggle
  • Rounded percentages that overstate

What props does Precise Number accept?

PreciseNumber props
PropTypeDefault
value* (required)

The exact value. For `percent`, a ratio (0.996 = 99.6%).

number—
format

Show a plain number or a percentage.

"number" | "percent""number"
currency

ISO currency code, e.g. "INR" or "USD".

string—
system

Lakh/crore or million/billion (controlled).

NumberSystem—
defaultSystem

Starting system when uncontrolled. Defaults to Indian for INR, international otherwise.

NumberSystem—
toggleable

Show a button that switches between the two systems.

booleanfalse
onSystemChange

Called when the toggle switches systems.

(system: NumberSystem) => void—
digits

Decimals shown: compact numbers default to 1 (truncated, never rounded up), percentages to 0.

number—
edge

For percentages: "<100%" (`bound`) or "99.6%" (`expand`) near 0% and 100%.

"bound" | "expand""expand"
exactLabel

Screen-reader prefix of the exact value in the tooltip.

string"Exactly"
toggleLabel

Accessible name of the system toggle; receives the system it switches to.

(next: NumberSystem) => string(next) => `Show in ${next === "international" ? "million …

* required. Also accepts the native props of <span> (className, aria-*, data-*…), passed through to it.

How is Precise Number accessible?

  • Approximate values are focusable and described by the exact-value tooltip
  • Spoken units are given as text for screen readers
  • Toggle has an aria-label naming the system it switches to
  • Roll animation is skipped under reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Display only; it doesn't parse input
  • Cutting means the compact figure can be slightly low; the tooltip is the exact value

What expensive mistakes does Precise Number stop?

₹1.24 Cr rounded up to ₹1.3 Cr

Also known as

compact number · lakh · crore · number format · intl · tooltip · dashboard · ₹

Field type

What dependencies does Precise Number require?

Precise Number facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePrecise Number
Registry identifier@bollard/precise-number
Install commandnpx shadcn@latest add @bollard/precise-number
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react, @floating-ui/react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Precise Number

How does Precise Number validate Indian financial identifiers?

Precise Number stops ₹1.24 Cr rounded up to ₹1.3 Cr. Complies with national standards for ₹99,99,999 shown as ₹1 Cr: it reads ₹99.9 L instead, Exact value hidden: tooltip on hover or focus, Lakh/crore vs million confusion, with a toggle, Rounded percentages that overstate. Limitation: verify precise-number with issuer gateway.

How do I install precise-number with shadcn?

Run `npx shadcn@latest add @bollard/precise-number`. Sources added: registry/default/precise-number/precise-number.tsx. Package requirements: lucide-react, @floating-ui/react, motion.

What props customize Precise Number?

Precise Number accepts `value`, `format`, `currency`, `system`, `defaultSystem`. Configures compact number, lakh, crore behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of precise-number?

Display only; it doesn't parse input. Cutting means the compact figure can be slightly low; the tooltip is the exact value Server requirement: backend verification for precise-number.

How does Precise Number meet accessibility guidelines?

Approximate values are focusable and described by the exact-value tooltip. Spoken units are given as text for screen readers. Toggle has an aria-label naming the system it switches to. Roll animation is skipped under reduced motion. Minimizes errors: number rounded up wrongly, compact number format.

Which components pair with Precise Number?