Skip to content

Commit

Permalink
Fix parsing double type without decimal point
Browse files Browse the repository at this point in the history
  • Loading branch information
nallwhy committed Nov 7, 2021
1 parent 6fff364 commit d135a1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/instream/decoder/csv.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ defmodule Instream.Decoder.CSV do
defp parse_datatypes({{field, "boolean"}, _}), do: {field, false}
defp parse_datatypes({{field, "double"}, "+Inf"}), do: {field, :infinity}
defp parse_datatypes({{field, "double"}, "-Inf"}), do: {field, :neg_infinity}
defp parse_datatypes({{field, "double"}, value}), do: {field, String.to_float(value)}
defp parse_datatypes({{field, "double"}, value}), do: {field, Float.parse(value) |> elem(0) }
defp parse_datatypes({{field, "duration"}, value}), do: {field, String.to_integer(value)}
defp parse_datatypes({{field, "long"}, value}), do: {field, String.to_integer(value)}
defp parse_datatypes({{field, "unsignedLong"}, value}), do: {field, String.to_integer(value)}
Expand Down

0 comments on commit d135a1d

Please sign in to comment.