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

# TapFormatters

> The tap.format helpers, which format in tap.locale and tap.timezone so a number or a date reads the way the rest of the host reads.

The `tap.format` helpers, which format in `tap.locale` and `tap.timezone` so a
number or a date reads the way the rest of the host reads.

## Remarks

The host takes both from the browser. The testing mock does not: it formats in
`en-US` and UTC so an expected string does not move with the machine running the
test, and its `date` and `relative` answer differently from the host's — `date`
ignores `style` and returns `YYYY-MM-DD`, and `relative` returns a whole ISO
timestamp rather than a phrase. Assert on your own formatting, not on either of
those two strings.

## Methods

### currency()

```ts theme={null}
currency(value, code): string;
```

`code` is an ISO currency code, such as `USD`.

#### Parameters

##### value

`number`

##### code

`string`

#### Returns

`string`

***

### date()

```ts theme={null}
date(value, style?): string;
```

Formats the date alone, with no time part. In the host, `long` is the only
style that changes anything: every other value renders the medium form.

#### Parameters

##### value

`string` | `Date`

##### style?

`"short"` | `"long"`

#### Returns

`string`

***

### number()

```ts theme={null}
number(value, options?): string;
```

Groups digits the way the owner's locale does.

#### Parameters

##### value

`number`

##### options?

`NumberFormatOptions`

#### Returns

`string`

***

### relative()

```ts theme={null}
relative(value): string;
```

In the host, the distance from now in whole days, such as `3 days ago`.

#### Parameters

##### value

`string` | `Date`

#### Returns

`string`
