View Source Money.Ecto.Map.Type (Money SQL v1.11.0)

Implements Ecto.Type behaviour for Money, where the underlying schema type is a map.

This is the required option for databases such as MySQL that do not support composite types.

In order to preserve precision, the amount is serialized as a string since the JSON representation of a numeric value is either an integer or a float.

Decimal.to_string/1 is not guaranteed to produce a string that will round-trip convert back to the identical number.

Summary

Functions