Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Implemented JsonSerializable#75

Open
zakini wants to merge 1 commit intoCoder-Spirit:masterfrom
zakini:json-serializable
Open

Implemented JsonSerializable#75
zakini wants to merge 1 commit intoCoder-Spirit:masterfrom
zakini:json-serializable

Conversation

@zakini
Copy link

@zakini zakini commented May 13, 2020

This allows Decimal objects to be JSON serialized using json_encode(). They are serialized as their internal string representation since this is the most accurate.

Using json_encode($decimal, JSON_NUMERIC_CHECK) results in the decimal value being serialized as a JSON number, which might be desirable for some users. This might be worth documenting, though I'm not sure where would be best to put that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants