Support for localized formatting is provided for the properties with the following data types: currency / money, dates / times and percentages.

By default, formatted values are not output with resources. If you would like to receive formatted values, simply append `formatted=true` to the URL of any API request. The output will include an additional object named `formatted` that includes all properties that are eligible for formatting, using the same property name.

For example, here is a portion of a cart response without formatting:

```
{
  "object": "cart",
  "cart_id": "0092790998816CagdfyG8B",
  "date_created": "2015-12-10T23:16:38Z",
  "date_modified": "2015-12-10T23:17:57Z",
  "currency": "USD",
  "subtotal": 119.9,
  "shipping": 5,
  "discount": 0,
  "tax": 9.38,
  "total": 134.28
}
```

And here's the same cart with the the `formatted=true` option supplied:

```
  "object": "cart",
  "cart_id": "0092790998816CagdfyG8B",
  "date_created": "2015-12-10T23:16:38Z",
  "date_modified": "2015-12-10T23:17:57Z",
  "currency": "USD",
  "subtotal": 119.9,
  "shipping": 5,
  "discount": 0,
  "tax": 9.38,
  "total": 134.28,
  "formatted": {
    "subtotal": "$119.90",
    "shipping": "$5.00",
    "tax": "$9.38",
    "total": "$134.28",
    "date_created": "12/10/2015 11:16 PM",
    "date_modified": "12/10/2015 11:17 PM"
  }
```

As you can see, you can now easily access unformatted and formatted values in code like this:

```
cart.total
cart.formatted.total
```

#### What locale and culture is used for formatting?

We use a variety of techniques to determine the how to format the values according to the logic below:

##### For requests in client-side environments

You don't need to do anything; the locale is detected automatically from the browser settings. You can, however, override the automatic selection by providing `user_locale` in a query string URL parameter in the API request the same way described in the server side environment below.

##### For requests in server-side environments

You can provide the user's locale as a URL query string parameter to any API request using the [two-character ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), like this:

For French: `user_locale=fr`

For German: `user_locale=de`

You can also use extended codes to give more precision, for example:

For French / Canada: `user_locale=fr-CA`

For German / Austria: `user_locale=de-AT`

For English / United States: `user_locale=en-US`

As a best practice in server-side requests, simply pass through the entire browser `Accept-Language` property in the `user_locale` URL query string parameter and the API will parse it and automatically choose the proper formatting to use.

If no user\_locale is provided, the default account locale is applied.
