---
title: "Discussion on \"Modeling money and big integers in OpenAPI: int64 precision, decimal amounts, and why number fails for currency\" | Hashnode"
description: "Discussion on \"Modeling money and big integers in OpenAPI: int64 precision, decimal amounts, and why number fails for currency\". JSON numbers are parsed as doubles, so a 19-digit order id or an exact currency amount can lose digits the moment a client decodes them. Large ids often belong in strings, and money almost never belongs in type:number. Here is the precision table, the string-as-decimal pattern, a"
url: "https://hashnode.com/posts/openapi-int64-bigint-decimal-money-numbers/6aca077f699990d79ccd9ef9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Modeling money and big integers in OpenAPI: int64 precision, decimal amounts, and why number fails for currency](https://blogs.powerduck.com/openapi-int64-bigint-decimal-money-numbers?utm_source=hashnode&utm_medium=feed)

JSON numbers are parsed as doubles, so a 19-digit order id or an exact currency amount can lose digits the moment a client decodes them. Large ids often belong in strings, and money almost never belongs in type:number. Here is the precision table, the string-as-decimal pattern, a

Oct 8 · 6 min read · blogs.powerduck.com  
Read the article

-   [#openapi](https://hashnode.com/tag/openapi)
-   [#api-design](https://hashnode.com/tag/api-design)
-   [#json](https://hashnode.com/tag/json)
-   [#best-practices](https://hashnode.com/tag/best-practices)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
