Skip to content

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

Open
@nesl247

Description

@nesl247

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"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions