Overview
Roxom APIs use standardized decimal formatting to ensure precision and consistency across all financial data. Understanding these formats is crucial for accurate calculations and data interpretation.Precision Standards
All monetary and price values in Roxom APIs follow these precision standards:String Representation
Example Response
Parsing Guidelines
JavaScript/TypeScript
Python
Java
Currency Pairs and Precision
Different trading pairs may have specific precision requirements:Major Pairs (8 decimal places)
Minor Pairs (6 decimal places)
Formatting for Display
When displaying values to users, consider appropriate rounding:Validation
Always validate decimal inputs before sending to the API:Common Pitfalls
Floating Point Arithmetic
Floating Point Arithmetic
Never use native floating-point arithmetic for financial calculations:
JSON Parsing
JSON Parsing
Configure JSON parsers to preserve numerical precision:
Database Storage
Database Storage
Use appropriate decimal/numeric types in databases:
Next Steps
Market Data
Learn how decimal formatting applies to market data endpoints