towerops/src/towerops_numeric_ffi.erl
Graham McIntire 6859525a1b Integrate Gleam into the build pipeline and rewrite three pure-function modules (#98)
Set up mix_gleam archive, gleam_stdlib, and gleeunit deps. Add Gleam
compiler to all Dockerfiles, CI workflows, nix shell, and .tool-versions.

Rewrite Numeric, QueryHelpers, and URLValidator from Elixir to Gleam with
full ExUnit test coverage. Update all callers to use the Gleam modules
directly via :towerops@module syntax. Remove duplicate sanitize_like/1
private functions in snmp.ex and trace.ex.

Reviewed-on: graham/towerops-web#98
2026-03-21 07:30:36 -05:00

14 lines
320 B
Erlang

-module(towerops_numeric_ffi).
-export([parse_integer/1, parse_float/1]).
parse_integer(S) ->
case 'Elixir.Integer':parse(S) of
{I, _} -> {ok, I};
error -> {error, nil}
end.
parse_float(S) ->
case 'Elixir.Float':parse(S) of
{F, _} -> {ok, F};
error -> {error, nil}
end.