fix: reworking some code smell issues
This commit is contained in:
9
lib/bds/strings.ex
Normal file
9
lib/bds/strings.ex
Normal file
@@ -0,0 +1,9 @@
|
||||
defmodule BDS.Strings do
|
||||
@moduledoc """
|
||||
Small string-formatting helpers shared across the codebase.
|
||||
"""
|
||||
|
||||
@doc "Zero-pads an integer to at least two digits, e.g. `3 -> \"03\"`."
|
||||
@spec pad2(integer()) :: String.t()
|
||||
def pad2(value), do: value |> Integer.to_string() |> String.pad_leading(2, "0")
|
||||
end
|
||||
Reference in New Issue
Block a user