|
|
|
|
|
by fauigerzigerk
34 days ago
|
|
What's your preferred solution to dealing with FX conversions? My issue with using integers everywhere is that FX conversions (or other rates) always come into play, and at that point I'm forced to use something else anyway (e.g. arbitrary precision decimals). |
|
In not-a-fintech we just went with doubles and rounded up (worst case - we get a cent more of a customer).
Though if I had to design today for that, I'd look for non-string serializable decimal, so not "10.123 == (10, 123)" but more like (10123, 3) and serialize in JSON as a value and precision separately.
Yet that's only cause I saw Decimal(10,123) sent in JSON as "10.123" which JSON reader red as 10.122 float and inserted to "1012" to database.