> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/api/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/api/introduction/quantity-and-price-representation.md).

# Quantity & Price Representation

When working with prices, percentages, and quantities in the Flow Retail API, it’s important to understand how numeric values are represented.

## Integers Represent Decimals

All amounts, percentages, and quantities in the API are returned and expected as integers, where the value represents a decimal with two fixed decimal places.

* Example:
  * 100 → 1.00
  * 2500 → 25.00
  * -150 → -1.50

This means you never send or receive floating-point numbers like 1.00 or 25.50 directly in the API. Instead, you work with whole numbers that implicitly include two decimal places.

## Why We Use Integers Instead of Floats

#### We follow this design for consistency and accuracy:

1. **Avoid rounding errors**

   Floating-point math in programming languages can introduce tiny rounding inaccuracies. Integers are exact, which is critical for financial data like sales orders and payments, and for stock and warehouse data.
2. **Consistent representation**

   By fixing the scale (2 decimal places), all amounts are handled uniformly across endpoints and integrations.
3. **Cross-platform compatibility**

   Some languages and databases treat decimal and floating-point values differently. Using integers ensures consistent values across all systems.

## How This Affects Development

#### When integrating:

* **Parsing API data**

  Divide by 100 to get the actual value in your application.

```
const amountCents = 2500; // From API
const amount = amountCents / 100; // 25.00
```

* **Sending data to the API**

  Multiply by 100 before sending.

```
const amount = 25.00; // In your app
const amountCents = Math.round(amount * 100); // 2500 for API

```

* **Percentages**

  Percent values follow the same rule: 250 = 2.50%, 1000 = 10.00%.
* **Quantities**

  Quantities also support decimals via the same fixed scale: 150 = 1.50 units.

## Examples

#### Price Example:

```
{
  "price": 1299,   // = 12.99
  "taxRate": 250   // = 2.50% VAT
}
```

#### Quantity Example:

```
{
  "quantity": 150  // = 1.50 units
}
```

## Summary

* Integers with two implied decimal places for amounts, percentages, and quantities.
* Reason: Accuracy, consistency, and cross-platform safety.
* Conversion rule:
  * API → App: divide by 100
  * App → API: multiply by 100


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
