Hi Akshay,
These are good points to raise.
When talking about floating point numbers, usually people are referring to IEEE 754 binary floating point values which, as you rightly say, can't accurately represent certain decimal values.
Note however the Money.value is specified as having "type" of "number" and a "format" of "float". The "type" in a JSON Schema "number" is one of the JSON primitive types. And JSON number values are serialised as a textual sequence of decimal digits - so there's no problem representing any decimal value in JSON.
The "format" in the schema is an annotation that allows there to be a fractional part in a JSON document. It doesn't specify how the value is handled/stored by an application internally. This is to say that parsing JSON numbers is a matter for the JSON library being used. If the library were to convert JSON numbers to BigDecimal point values, then it would faithfully represent decimal floating point values (e.g. 0.1) that can't be represented in binary floating point value.
So the recommendation would be that Money.value should be parsed/stored in a suitable internal representation by applications in order that precision is maintained, with the caveat that binary floating point is problematic.
Regards,
Graham
------------------------------
Graham Agnew
CSG Systems, Inc.Graham Agnew
CSG Systems, Inc.
------------------------------
Original Message:
Sent: Feb 04, 2026 05:49
From: Akshay Sahni
Subject: Money value | All APIs
Hello,
- Most of the TMF APIs specify money.Value to be an object of type float.
- However, float causes loss of accuracy for amounts for ex. $36.10 is returned as $36.1.
- Most money values are stored and communicated in terms of big decimal to maintain the sanctity of transactions. This is needed for compliance/reconciliation
- Java Specification Registry #354 specifies using big decimal.
Are there any recos from the wider community on preference OR COTS specification for the same?
Edit 1:
More on the accuracy on using float as a data type why float numbers are inaccurate - because they are stored in binary, hence the following example:
1. 0.1 + 0.2 ≠ 0.3 in float rather it is
0.1 + 0.2 = 0.30000000000000004 stored in the data base.
This might lead to accumulation of errors over reconciliation and reporting.
Regards,
------------------------------
Akshay Sahni
Orange S.A.
------------------------------