> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/quantity-and-price-representation.md).

# Quantity & price representation

Every amount, percentage and quantity is an integer with two implied decimals.

This is the single rule that breaks the most integrations, so it is worth two minutes.

**All amounts, percentages and quantities in the API are integers**, where the value carries two implied decimal places. There are no floating-point numbers anywhere in the API.

| Sent or received | Means |
| ---------------- | ----- |
| `100`            | 1.00  |
| `1299`           | 12.99 |
| `2500`           | 25.00 |
| `-150`           | -1.50 |

## Why integers

1. **No rounding errors.** Floating-point arithmetic introduces small inaccuracies that are unacceptable for money, and just as unacceptable for stock levels that have to reconcile.
2. **One consistent scale.** Every amount on every endpoint uses the same fixed two decimals, so there is never a per-field question about precision.
3. **Portable across languages.** Languages and databases disagree about how to represent decimals. They agree about integers.

## Converting

**Reading from the API** — divide by 100:

```javascript
const amountMinor = 2500;          // from the API
const amount = amountMinor / 100;  // 25.00
```

**Sending to the API** — multiply by 100 and round explicitly:

```javascript
const amount = 25.00;                             // in your application
const amountMinor = Math.round(amount * 100);     // 2500 for the API
```

The `Math.round` is not decoration. `19.99 * 100` is `1998.9999999999998` in JavaScript, and truncating gives you 1998 — a one-øre error that will surface in reconciliation weeks later.

In a language with a decimal type, prefer that over floats for the intermediate value, and convert to integer only at the boundary.

## It applies to percentages and quantities too

The same fixed scale covers more than money:

```json
{
  "price": 1299,     // 12.99
  "taxRate": 250,    // 2.50 %
  "quantity": 150    // 1.50 units
}
```

Quantities being scaled the same way is easy to miss. A quantity of `1` is **0.01 units**, not one unit. One unit is `100`.

## In short

| Direction       | Do                          |
| --------------- | --------------------------- |
| API to your app | divide by 100               |
| Your app to API | multiply by 100, then round |
| Anywhere        | never send a decimal point  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/quantity-and-price-representation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
