> ## Documentation Index
> Fetch the complete documentation index at: https://quill.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# format

> A simple way to format data from Quill

```tsx App.tsx theme={null}
import { format } from "@quillsql/react";

function formatExample() {
  format({ value: 123.45, format: "dollar_cents" }); // "$123.45"
  format({ value: 123, format: "dollar_cents" }); // "$123.00"
}
```

`format` accepts a single options object.

<ParamField path="value" type="any" required>
  The value to format. Numbers are accepted for numeric formats; strings or
  ISO-8601 date strings are accepted for date formats.
</ParamField>

<ParamField
  path="format"
  type="'percent' |
'dollar_amount' |
'dollar_cents' |
'whole_number' |
'one_decimal_place' |
'two_decimal_places' |
'string' |
'yyyy' |
'MMM_yyyy' |
'MMM_dd_yyyy' |
'MMM_dd' |
'hh_ap_pm' |
'MMM_dd-MMM_dd' |
'MMM_dd_hh:mm_ap_pm' |
'wo, yyyy'"
  required
>
  The Quill format type to apply to `value`.
</ParamField>
