towerops/src/snmpkit_formatting_ffi.erl
Graham McIntire 348975dcc9 Rewrite polling_offset, changelog_parser, and user_agent_parser in Gleam (#103)
Migrate three pure-function modules from Elixir to Gleam:

- polling_offset: deterministic hash-based polling offset (pure Gleam, no FFI)
- changelog_parser: text parsing logic in Gleam, thin Elixir wrapper for File I/O
- user_agent_parser: regex-based UA parsing in Gleam with Erlang FFI for
  atom-keyed map conversion

Add gleam_regexp dependency for regex support in Gleam modules.
Update all call sites and tests to use Gleam module atoms.

Reviewed-on: graham/towerops-web#103
2026-03-21 10:11:06 -05:00

6 lines
271 B
Erlang

-module(snmpkit_formatting_ffi).
-export([format_float/2]).
%% Format a float to a string with the specified number of decimal places.
format_float(Value, Decimals) when is_float(Value), is_integer(Decimals) ->
erlang:float_to_binary(Value, [{decimals, Decimals}]).