GajuDesk/src/gd_lib.erl

17 lines
361 B
Erlang

%%% @doc
%%% GajuDesk Helper Functions
%%% @end
-module(gd_lib).
-vsn("0.8.2").
-export([is_int/1]).
-spec is_int(string()) -> boolean().
%% @doc
%% A simple boolean check over whether every character in a string is part of an integer value
%% without the trashy `try .. catch' way.
is_int(S) ->
lists:all(fun(C) -> $0 =< C andalso C =< $9 end, S).