In JSON there is only a number, not a float or integer. The real problem comes into play when getting data from a web client via JSON that is expected to be a float but is encoded in JSON without a decimal. For example, 55.0 using json.float will return 55 which then must be decoded as an Integer in Gleam, not a float.
In JSON there is only a number, not a float or integer. The real problem comes into play when getting data from a web client via JSON that is expected to be a float but is encoded in JSON without a decimal. For example, 55.0 using
json.float
will return55
which then must be decoded as an Integer in Gleam, not a float.