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.
This allows
Decimal
objects to be JSON serialized usingjson_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.