php-bignumbers icon indicating copy to clipboard operation
php-bignumbers copied to clipboard

Implemented JsonSerializable

Open zakini opened this issue 4 years ago • 0 comments

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.

zakini avatar May 13 '20 13:05 zakini