From dea64e60c0e84e6fa22fb99b4341e6e62e7da40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 1 May 2024 13:18:01 +0200 Subject: [PATCH] Update lib/myxql/protocol/values.ex --- lib/myxql/protocol/values.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/myxql/protocol/values.ex b/lib/myxql/protocol/values.ex index 60b35c3..3baf5ae 100644 --- a/lib/myxql/protocol/values.ex +++ b/lib/myxql/protocol/values.ex @@ -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