felt / geo

A collection of GIS functions for Elixir
MIT License
649 stars 88 forks source link

ensure_numeric in JSON.Decoder breaks when the string is an integer. not a float #220

Closed IceDragon200 closed 2 months ago

IceDragon200 commented 2 months ago

This commit introduced a regression where coordinates that exclude their decimal point (i.e. an integer format) are now unable to decode since:

iex(1)> String.to_float("12")
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not a textual representation of a float

    :erlang.binary_to_float("12")
    iex:1: (file)
iex(1)> String.to_float("12.0")
12.0
s3cur3 commented 2 months ago

Resolved by #221