@@ -64,7 +64,7 @@ Here's an example of that format:
64
64
65
65
### Option 1: Floating point
66
66
67
- Monetary values are represented as strings with fixed decimal points (e.g., ` 1234.56 ` for $1234.56).
67
+ Monetary values are represented as a floating point number (e.g., ` 1234.56 ` for $1234.56).
68
68
69
69
- ** Pros**
70
70
- Human-readable and easier for API consumers to debug.
@@ -76,13 +76,13 @@ Monetary values are represented as strings with fixed decimal points (e.g., `123
76
76
77
77
### Option 2: Decimal string
78
78
79
- Monetary values are represented as strings with fixed decimal points (e.g., ` "1234.56" ` for $1234.56).
79
+ Monetary values are represented as a string-formatted decimal value (e.g., ` "1234.56" ` for $1234.56).
80
80
81
81
- ** Pros**
82
82
- Human-readable and easier for API consumers to debug.
83
83
- No conversion required for display or consumer-facing applications.
84
84
- Suitable for currencies with non-standard subunits (e.g., cryptocurrencies).
85
- - Commonly used format for monetary values, e.g. PayPal, ApplePay , etc.
85
+ - Commonly used format for monetary values, e.g., PayPal, Apple Pay, Google Pay , etc.
86
86
- ** Cons**
87
87
- Vulnerable to floating-point precision issues if parsed into floating-point numbers.
88
88
- Parsing and validation of string inputs are more complex than integers.
@@ -97,7 +97,7 @@ Monetary values are represented as integers in the smallest unit of the currency
97
97
- Ideal for aggregation, sorting, and other arithmetic operations.
98
98
- Compact representation (smaller payloads compared to string decimals).
99
99
- Consistent format across implementations.
100
- - Commonly used format for monetary values, e.g. Stripe, Square.
100
+ - Commonly used format for monetary values, e.g., Stripe, Square, etc .
101
101
- ** Cons**
102
102
- Less human-readable than string representations.
103
103
- Requires explicit documentation of smallest unit conventions (e.g., cents for USD, yen has no subunit).
0 commit comments