# Amount

> An amount of money given as integer minor units and an ISO 4217 code, written by `@sdxc/money` in any locale: the currency's own decimals (none for yen), a true minus, an incoming-money tone, and smaller cents for a balance that leads a screen.

```ts
import { Amount } from "@sdxc/ui";
```

Renders an amount in a native `<data>` element whose `value` is the decimal figure, so a
script or a crawler reads the number while a person reads the formatted one. Figures are
tabular, so a column of amounts lines up, and the amount never wraps.

## Examples

```tsx
<Amount value={-1299} currency="EUR" locale="en-IE" />
```

```tsx
<Amount value={4500} currency="GBP" sign="ledger" />
```

```tsx
<Amount value={1284056} currency="EUR" smallMinor />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `value` | `number` | The amount in the currency's minor units (cents, pence; whole yen), as an integer. |
| `currency` | `string` | The ISO 4217 code, such as `EUR` or `JPY`. |
| `locale?` | `string` |  |
| `sign?` | `Sign` |  |
| `smallMinor?` | `boolean` | Sets the decimals in a smaller size, for a balance that heads a screen. @default false |
| `compact?` | `boolean` | Abbreviates large amounts (`€12K`), for a chart axis or a tight tile. @default false |
| `display?` | `"symbol" \| "narrowSymbol" \| "code"` | `symbol` (`$`), `narrowSymbol` (`$` for every dollar) or `code` (`USD`). @default "narrowSymbol" |

Also accepts everything in `Omit<TagProps<"data">, "value" | "children">`.

