

Formatters transform data into user-friendly strings with proper locale support and opinionated defaults (Australian locale by default).

<Callout type="warn" title="Display only">
  These formatters are intended for UI display purposes only. They apply
  rounding, truncation, and locale-specific transformations that make data
  human-readable but unsuitable for database storage or calculations.
</Callout>

## Available Formatters [#available-formatters]

<Cards>
  <Card title="Byte" description="Format file sizes into human-readable strings." href="/utilities/formatters/byte" />

  <Card title="Date" description="Date and time formatting utilities with locale-aware display and relative time formatting." href="/utilities/formatters/date" />

  <Card title="Duration" description="Format duration in seconds to human-readable time strings." href="/utilities/formatters/duration" />

  <Card title="File" description="Format file types and extensions into human-readable strings." href="/utilities/formatters/file" />

  <Card title="Number" description="Format numbers with locale support, compact notation, percentages, and ordinals." href="/utilities/formatters/number" />

  <Card title="Currency" description="Format monetary values with proper symbols and locale support." href="/utilities/formatters/currency" />

  <Card title="Name" description="Format person names with various display options." href="/utilities/formatters/name" />

  <Card title="Percentage" description="Format decimal values as percentage strings with null-safe handling." href="/utilities/formatters/percentage" />

  <Card title="Phone" description="Format and validate phone numbers with international support." href="/utilities/formatters/phone" />

  <Card title="Text" description="Text manipulation utilities for truncation, pluralization, capitalization, and more." href="/utilities/formatters/text" />

  <Card title="Upload" description="Format upload progress, speed, and estimated time." href="/utilities/formatters/upload" />
</Cards>

## Usage [#usage]

All formatters are available as named exports from `@tilt-legal/cubitt-components`:

```tsx
import {
  formatBytes,
  formatCurrency,
  formatDuration,
  formatRelativeTime,
  formatPhone,
} from "@tilt-legal/cubitt-components/utilities/formatters";

formatBytes(1048576); // "1 MB"
formatCurrency(1234.56); // "$1,234.56" (AUD)
formatDuration(154); // "2:34"
formatRelativeTime(new Date()); // "just now"
formatPhone("0412345678"); // "0412 345 678"
```
