Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rounded floats produce an error #1

Open
sunneach opened this issue Jun 18, 2009 · 0 comments
Open

rounded floats produce an error #1

sunneach opened this issue Jun 18, 2009 · 0 comments

Comments

@sunneach
Copy link
Contributor

I had to supply missing ".0" to some rounded floats to avoid errors. Here is the patch:

pgsql_util.erl, line 267:

decode_col(#desc{format=text, type=Float}, Value)
when Float =:= float4; Float =:= float8 ->
ListValue = binary_to_list(Value),
IsFloat = string:str(ListValue,"."),
if IsFloat > 0 -> FValue = Value;
true -> FValue = Value ++ ".0"
end,

list_to_float(FValue);

http://onerlang.blogspot.com/2009/06/what-is-float.html

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

No branches or pull requests

1 participant