# Amount

A formatted figure with steady digits, in any currency and locale. Every amount in Bevel is one of these.

- Category: Money
- Docs: https://bevel-ui.vercel.app/components/amount
- Import from: `@/components/ui/amount`

## Install

```bash
npx shadcn@latest add @bevel/amount
```

npm dependencies (installed by the CLI): `cn`.

## Anatomy

```tsx
<Amount value={1240.5} currency="USD" />
```

## Parts

| Part | Renders | Description |
| --- | --- | --- |
| `Amount` | span | value, currency (ISO 4217; omit for plain numbers), locale (fixed to en-US by default so server and client match), format, and signed for a leading +. Exposes data-sign. |

## Example: Currencies and locales

Digits are tabular so columns line up; separators keep their natural width in any font.

```tsx
import { Amount } from "@/components/ui/amount"

const rows = [
  { label: "US dollars", value: 1240.5, currency: "USD" },
  { label: "Euros, German format", value: 1240.5, currency: "EUR", locale: "de-DE" },
  { label: "Yen, no minor unit", value: 98765, currency: "JPY", locale: "ja-JP" },
  { label: "Rupees, Indian grouping", value: 1234567.8, currency: "INR", locale: "en-IN" },
  { label: "Credits, signed", value: 500, signed: true },
]

export function AmountFormats() {
  return (
    <dl className="flex flex-col gap-3 text-sm">
      {rows.map(({ label, ...amount }) => (
        <div key={label} className="flex items-baseline justify-between gap-6">
          <dt className="text-muted-foreground">{label}</dt>
          <dd className="font-semibold">
            <Amount {...amount} />
          </dd>
        </div>
      ))}
    </dl>
  )
}
```
