Amounts and Rates
Learn how the API returns amounts, rates and quantities as decimal strings, and why you should not rely on a fixed number of decimals.
The API returns amounts, rates and quantities as decimal strings, for example "20.42" or "0.104". A string keeps the exact value. Read these values with a decimal type and not with a floating-point number.
The number of decimals can grow
A field can have a minimum number of decimals. For example, "0.20" has at least 2 decimals. We can add more decimals to a field when we need more precision. We do not treat this as a breaking change.
Please:
- Do not assume that a field always has the same number of decimals.
- Do not cut or round the value before you use it.
- Accept values with more decimals than you see today.
For example, the cost rates product_costs_pct, running_costs_pct and impact_subsequent_year_pct in the regulatory_disclosures of orders and workflows have at least 2 decimals, such as "0.20" or "0.104".
Updated 31 minutes ago