Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Add float type #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/etest_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ make_query({Key, Value}) when is_binary(Value) ->
make_query({Key, Value}) when is_integer(Value) ->
make_query({Key, integer_to_list(Value)});

make_query({Key, Value}) when is_float(Value) ->
make_query({Key, lists:flatten(io_lib:format("~p", [Value]))});

% Key to list
make_query({Key, Value}) when is_atom(Key) ->
make_query({atom_to_list(Key), Value});
Expand All @@ -88,4 +91,7 @@ url_encode(Value) when is_bitstring(Value) ->
url_encode(binary_to_list(Value));

url_encode(Value) when is_integer(Value) ->
Value;

url_encode(Value) when is_float(Value) ->
Value.