Current section
Files
Jump to
Current section
Files
lib/rollex/utilities.ex
defmodule Rollex.Utilities do
@float_precision 4
@max_sides 1_000
@max_quantity 1_000
@max_keeps 1_000
def simple_float_parse("") do
1.0
end
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
end
def simple_integer_parse(input) when is_binary(input) do
{value, _} = Integer.parse(input)
value
end
end