mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Merge pull request #281 from mDuo13/doc1088
"Money in the XRP Ledger" intro and related
This commit is contained in:
7
content/snippets/string-number-formatting.md
Normal file
7
content/snippets/string-number-formatting.md
Normal file
@@ -0,0 +1,7 @@
|
||||
XRP Ledger APIs generally use strings, rather than native JSON numbers, to represent numeric amounts of currency for both XRP and issued currencies. 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 as `0.5`. (American style, not European)
|
||||
* May contain `E` or `e` to indicate being raised to a power of 10 (scientific notation). For example, `1.2E5` is equivalent to 1.2×10<sup>5</sup>, or `120000`.
|
||||
* No comma (`,`) characters are used.
|
||||
Reference in New Issue
Block a user