Digit

Formats a numeric value using currency, precision, unit, locale, and sign options from the shared number utilities.

Interactive live playground

Tweak props, change states, and see the live component respond in real time.

Live

How to call

Import directly from the Loomora package root. For projects without Tailwind CSS, ensure loomora/dist/index.css is imported once in your root layout.

import { Digit } from 'loomora'

<Digit value={12845.75} decimalsMin={2} decimalsMax={2} endUnit="USD" />

API reference

Important public props and how they affect rendering.

5 props
PropTypeDefaultDescription
valuenumber | stringrequiredNumeric amount to format.
decimalsMinnumberconfig defaultMinimum fraction digits.
decimalsMaxnumberconfig defaultMaximum fraction digits.
startUnit / endUnitReactNode—Optional content before or after the formatted number.
currencycurrency options—Currency display configuration.