View Source Lexical.Formats (lexical_shared v0.5.0)
A collection of formatting functions
Link to this section Summary
Functions
Formats a name of a module Both elixir and erlang modules will format like they appear in elixir source code.
Formats an elapsed time to either seconds or milliseconds
Link to this section Types
Link to this section Functions
Formats a name of a module Both elixir and erlang modules will format like they appear in elixir source code.
Format.format(MyModule)
"MyModule"
Formats.module(Somewhat.Nested.Module)
"Somewhat.Nested.Module"
Format.format(:erlang_module)
":erlang_module"
@spec time(time :: non_neg_integer(), opts :: time_opts()) :: String.t()
Formats an elapsed time to either seconds or milliseconds
Examples:
Format.seconds(500, unit: :millisecond)
"0.5 seconds"
Format.format(1500, unit: :millisecond)
"1.4 seconds"
Format.format(1500)
"15 ms"