lpil / decode

Ergonomic dynamic decoders for Gleam!
72 stars 9 forks source link

Support decoding a "number" from JSON #19

Open jcowgar opened 6 days ago

jcowgar commented 6 days ago

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.

lpil commented 3 days ago

Thank you