-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type representing money values #105
Comments
Have checked this internally. In Telefonica, billing/charging systems manage "decimals" in a natural way. Providing amount as "integer" would have huge impacts in systems as it is needed to manage a conversion to identify the number of decimals to be considered. Usually merchants are aware of this kind of stuff in different countries and manage it. Then our position is to keep current model. Would also like to know opinions from other participants. Anyway, an enhancement is derived from your analysis @rartych. So for amount, should be needed to be described as:
float also includes integers so for currencies that do not consider decimals an integer can be signalled and Schema validation does cover it. |
25/10: Moving forward with
|
Closed as per PR#119 MERGED |
Problem description
Currently amounts of money are defined as:
Swafgger docs indicates
Possible evolution
Storing amount values as long integers is a common best practice
amount
integer
int64
currency
string
currency
Note: Minor units are specified according to ISO 4217 and can be found in this table.
Additional context
Recommendation in:
https://github.com/team-monite/api-style-guide/blob/main/Guidelines.md#should-use-the-common-money-object
Most currencies have two decimals. Some currencies do not have decimals, and some have three decimals. For example:
The text was updated successfully, but these errors were encountered: