Current section
Files
Jump to
Current section
Files
lib/rollex/utilities.ex
defmodule Rollex.Utilities do
@float_precision 4
def simple_float_parse(""), do: 1.0
def simple_float_parse(input) when is_binary(input) do
{value, _} = Float.parse(input)
Float.round(value, @float_precision)
end
def simple_integer_parse(""), do: 1
def simple_integer_parse(input) when is_binary(input) do
{value, _} = Integer.parse(input)
value
end
end