Permalink
Browse files

Perform float conversion; update README re: boss_news

  • Loading branch information...
1 parent fb871f4 commit 2ed23f4acffe1de12b510c88c6e4452eab941370 @evanmiller evanmiller committed Jan 20, 2013
Showing with 6 additions and 4 deletions.
  1. +1 −1 README.md
  2. +5 −3 src/boss_record_lib.erl
View
@@ -27,7 +27,7 @@ Usage
boss_db:start(DBOptions),
boss_cache:start(CacheOptions), % If you want cacheing with Memcached
- boss_news:start() % If you want events
+ boss_news:start() % Mandatory! Hopefully will be optional one day
DBOptions = [
{adapter, mock | tyrant | riak | mysql | pgsql | mnesia | mongodb},
@@ -77,6 +77,10 @@ convert_value_to_type(Val, integer) when is_list(Val) ->
list_to_integer(Val);
convert_value_to_type(Val, integer) when is_binary(Val) ->
list_to_integer(binary_to_list(Val));
+convert_value_to_type(Val, float) when is_float(Val) ->
+ Val;
+convert_value_to_type(Val, float) when is_integer(Val) ->
+ 1.0 * Val;
convert_value_to_type(Val, string) when is_integer(Val) ->
integer_to_list(Val);
convert_value_to_type(Val, string) when is_binary(Val) ->
@@ -117,6 +121,4 @@ convert_value_to_type("false", boolean) -> false;
convert_value_to_type(1, boolean) -> true;
convert_value_to_type(0, boolean) -> false;
convert_value_to_type(true, boolean) -> true;
-convert_value_to_type(false, boolean) -> false;
-
-convert_value_to_type(Val, float) -> Val.
+convert_value_to_type(false, boolean) -> false.

0 comments on commit 2ed23f4

Please sign in to comment.