pagantis_elixir_tools v0.17.5 ElixirTools.IntegerHelper

Helper module for dealing with Integers

Link to this section Summary

Functions

Ensures a value is an integer. If it is not, it tries to make it an integer. If it is not parsable, it returns the given default with a warning

Link to this section Functions

Link to this function

ensure_integer(key, value, default, opts \\ [])

ensure_integer(String.t(), any(), integer(), [ensure_integer_opt()]) ::
  integer() | no_return()

Ensures a value is an integer. If it is not, it tries to make it an integer. If it is not parsable, it returns the given default with a warning