Browse Source

Fix compilation issue on older Erlang releases.

If `binary_to_float` is not exported, the compiler thinks we are
calling a local function, which fails to compile.
Andreas Stenius 11 years ago
parent
commit
c7627394fe
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/erlydtl_filters.erl

+ 2 - 2
src/erlydtl_filters.erl

@@ -723,10 +723,10 @@ cast_to_float(Input) when is_binary(Input) ->
     %% be compatible with releases prior to R16B
     %% be compatible with releases prior to R16B
     case erlang:function_exported(erlang, binary_to_float, 1) of
     case erlang:function_exported(erlang, binary_to_float, 1) of
         true ->
         true ->
-            try binary_to_float(Input)
+            try erlang:binary_to_float(Input)
             catch
             catch
                 error:_Reason ->
                 error:_Reason ->
-                    binary_to_integer(Input) + 0.0
+                    erlang:binary_to_integer(Input) + 0.0
             end;
             end;
         false ->
         false ->
             cast_to_float(binary_to_list(Input))
             cast_to_float(binary_to_list(Input))