Skip to content

rounded floats produce an error #1

@sunneach

Description

@sunneach

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions