Skip to content

Commit

Permalink
Update lib/myxql/protocol/values.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim authored May 1, 2024
1 parent 3226b0c commit dea64e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/myxql/protocol/values.ex
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ defmodule MyXQL.Protocol.Values do
end

def decode_text_value(value, type) when type in [:float, :double] do
if String.contains?(value, "."), do: String.to_float(value), else: String.to_integer(value) * 1.0
if String.contains?(value, ".") do
String.to_float(value)
else
String.to_integer(value) * 1.0
end
end

# Note: MySQL implements `NUMERIC` as `DECIMAL`s
Expand Down

0 comments on commit dea64e6

Please sign in to comment.