Skip to content

Instantly share code, notes, and snippets.

@davidcoallier
Created April 13, 2010 09:45
Show Gist options
  • Save davidcoallier/364465 to your computer and use it in GitHub Desktop.
Save davidcoallier/364465 to your computer and use it in GitHub Desktop.
Binary_to_integer = fun(Bin) ->
case {is_binary(Bin), Bin /= <<>>} of
{true, true} ->
list_to_integer(binary_to_list(Bin));
_->
0
end
end,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment