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

# Money

> Tipo primitivo de preço na Storefront Data API.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
interface Money {
  amount: string;        // decimal como string — ex: "199.90"
  currencyCode: string;  // ex: "BRL"
  formatted: string;     // ex: "R$ 199,90"
}
```

## Por que `amount` é string?

Evita erros de ponto flutuante e mantém compatibilidade com gateways e APIs externas.

## Uso

```jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
<span>{product.price.formatted}</span>

// Comparar valores
if (Number(product.price.amount) > 100) { ... }
```

## Formatação

**Preferir** o campo `formatted` já mapeado pela API (respeita `shop.localization` da loja):

```jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
<span>{product.price.formatted}</span>
```

**Em sections React**, use `useLocalization()` ou `formatPrice` com contexto da loja:

```jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { useLocalization, formatPrice } from '@corvex/theme-sdk';

const { formatMoney, localization } = useLocalization();

formatMoney(199.9); // moeda + moneyFormat da loja
formatPrice(199.9, { localization });
```

Guia completo: [Locales e internacionalização](https://docs-loja.usecorvex.com.br/themes/locales.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.