# lib/money

> Source: https://devdocs.joy.so/joy-headless-api/sdk-reference/hydrogen/lib/money/ · Last updated: 2026-11-24

## Interfaces

### JoyMoney

The `/shop-config` subset every money-printing block needs.

#### Properties

##### currency

```ts
currency: string;
```

##### currencyFormat

```ts
currencyFormat: string;
```

## Functions

### formatMoney()

```ts
function formatMoney(value, money): string;
```

Render an amount with the shop's Shopify money format.

`currencyFormat` may carry markup (`<span class=money>${{amount}}</span>`) —
strip it, since this goes into a text node. Whole amounts drop the decimals:
"$10 off" reads better than "$10.00 off", and loyalty amounts are almost
always round.

#### Parameters

| Parameter | Type                    |
| --------- | ----------------------- |
| `value`   | `number`                |
| `money`   | [`JoyMoney`](#joymoney) |

#### Returns

`string`

***

### formatOrderMoney()

```ts
function formatOrderMoney(
   value, 
   money, 
   locale?
): string;
```

Receipt-grade money for the orders surface — ALWAYS 2 fraction digits plus
locale thousands grouping (`123456` cents → `$1,234.56`, `5000` → `$50.00`),
matching the core order path (`formatShopifyPrice` →
`displayMoneyValue({minimumFractionDigits: 2})`). An order receipt must show
cents and grouping; the loyalty-label [formatMoney](#formatmoney) deliberately drops
decimals on round amounts and adds no grouping, so this is a separate export
scoped to orders — do NOT swap it into the loyalty callers.

Keeps the shop's Shopify money format (currency symbol/placement); only the
number's own formatting changes. `value` is a decimal amount (already divided
out of cents), matching [formatMoney](#formatmoney).

#### Parameters

| Parameter | Type                    |
| --------- | ----------------------- |
| `value`   | `number`                |
| `money`   | [`JoyMoney`](#joymoney) |
| `locale?` | `string`                |

#### Returns

`string`
