mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-05 04:15:50 +00:00
878 B
878 B
XRP Ledger APIs generally use strings, rather than native JSON numbers, to represent numeric amounts of currency for both XRP and tokens. This protects against a loss of precision when using JSON parsers, which may automatically try to represent all JSON numbers in a floating-point format. Within the String value, the numbers are serialized in the same way as native JSON numbers:
- Base-10.
- Non-zero-prefaced.
- May contain
.as a decimal point. For example, ½ is represented as0.5. (American style, not European) - Negative amounts start with the character
-. - May contain
Eoreto indicate being raised to a power of 10 (scientific notation). For example,1.2E5is equivalent to 1.2×105, or120000. Negative exponents are also possible. - No comma (
,) characters are used.