Description
Prior to CDS 10, cds.features.ieee754compatible defaulted to false, meaning Decimal and Int64 fields were serialized as JSON numbers. CDS 10 changes this default to true, causing those fields to be serialized as JSON strings (e.g. "9.99" instead of 9.99) in OData responses. This is the IEEE 754-safe representation required by the OData specification to prevent precision loss in JavaScript clients. Code that reads these values and treats them as numbers — through arithmetic, strict numeric comparisons, or numeric type assertions — will silently produce wrong results or test failures. Consumers that already parse OData responses via SAP UI5 model binding are generally unaffected, as UI5 handles string-typed decimals correctly.
How to Check
- [ ] Check
cds envoutput forcds.features.ieee754compatible— if absent orfalse, the newtruedefault now applies and may affect the application. - [ ] Search service handler and test code for arithmetic on entity properties typed as
DecimalorInt64(e.g.entity.price + tax,entity.amount * rate). - [ ] Search test assertions that compare
Decimal/Int64fields to number literals (e.g.expect(result.price).toBe(9.99)orassert.equal(result.amount, 100)). - [ ] Check downstream consumers (UI5 apps, integration tests, REST clients) for numeric parsing of
Decimal/Int64response fields.
Migration Steps
Update arithmetic and comparison code to parse string values before use:
diff- const newPrice = item.price * 1.19; + const newPrice = parseFloat(item.price) * 1.19;diff- if (order.total > threshold) { ... } + if (parseFloat(order.total) > threshold) { ... }Update test assertions to expect string values:
diff- expect(result.price).toBe(9.99); + expect(result.price).toBe('9.99');diff- expect(result.amount).toStrictEqual(100); + expect(result.amount).toStrictEqual('100');If you need time to update consumers, temporarily set the compat flag to defer the change and restore the CDS 9 serialization behavior:
diff// package.json or .cdsrc.json { "cds": { "features": { + "ieee754compatible": false } } }Remove the flag once all consumers handle string-typed decimal values correctly.
If the application explicitly set
ieee754compatible: falseto opt out, remove the override to accept the new default — or keep it if consumers are not yet ready:diff// package.json or .cdsrc.json { "cds": { "features": { - "ieee754compatible": false } } }
Notes
The impact is highest for backend-to-backend integrations and test suites that compare numeric values directly. UI5-based frontends using OData model binding are typically unaffected because the UI5 OData model already treats Decimal values as strings internally. Java-based consumers using the CAP Java SDK are also unaffected — the Java runtime handles this transparently.