core icon indicating copy to clipboard operation
core copied to clipboard

Render BCMath\Number (PHP 8.4+) as string instead of object

Open nesl247 opened this issue 11 months ago • 2 comments

Description
In PHP 8.4.0, BcMath\Number was introduced as an OOP interface for bcmath. When an object defines a property with a type as Number, it is serialized as an object. It would be great if this was serialized as a string instead.

Example
Current:

"total": {
        "@type": "Number",
        "@id": "\/.well-known\/genid\/41767877a4385a2da6cc",
        "value": "503.6",
        "scale": 1
      },

Expected:

"503.60"

nesl247 avatar Jan 29 '25 20:01 nesl247

Good idea, we'll need https://github.com/symfony/symfony/issues/59651 first.

dunglas avatar Jan 29 '25 22:01 dunglas