Skip to content

Conversation

DanielZendejas
Copy link

Hi!

Since the time I wrote the issue another case came up besides the empty string to nil one. As it is right now Ecto.LazyFloat cannot parse strings like this:

iex(5)> Float.parse(".3")
:error

The fix I propose is appending the "0" to the beginning of a string that matches the regular expression ~r/^\.[0-9]+$/.

Also I added a couple of tests to the project, just for completeness. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant