containers v0.4.0 Containers.Int
Provides functions for interacting with the Integer primitive using containers.
Summary
Functions
Wraps the Elxir Integer.parse function and returns
Result container
Functions
Wraps the Elxir Integer.parse function and returns
Result container.
Examples
iex> Containers.Int.parse "34"
%Containers.Result{value: {:ok, {34, ""}}}
iex> Containers.Int.parse "34.5"
%Containers.Result{value: {:ok, {34, ".5"}}}
iex> Containers.Int.parse "three"
%Containers.Result{value: {:error, :no_parse}}
iex> Containers.Int.parse "a2", 38
%Containers.Result{value: {:error, "invalid base 38"}}