Current section
Files
Jump to
Current section
Files
src/humanise.erl
-module(humanise).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([microseconds_float/1, microseconds_int/1, milliseconds_float/1, milliseconds_int/1, seconds_float/1, seconds_int/1, hours_float/1, hours_int/1, days_float/1, days_int/1, weeks_float/1, weeks_int/1, bytes_float/1, bytes_int/1, kilobytes_float/1, kilobytes_int/1, megabytes_float/1, megabytes_int/1, gigabytes_float/1, gigabytes_int/1, terabytes_float/1, terabytes_int/1, kibibytes_float/1, kibibytes_int/1, mebibytes_float/1, mebibytes_int/1, gibibytes_float/1, gibibytes_int/1, tebibytes_float/1, tebibytes_int/1]).
-spec microseconds_float(float()) -> binary().
microseconds_float(N) ->
_pipe = {microseconds, N},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec microseconds_int(integer()) -> binary().
microseconds_int(N) ->
_pipe = {microseconds, gleam@int:to_float(N)},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec milliseconds_float(float()) -> binary().
milliseconds_float(N) ->
_pipe = {milliseconds, N},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec milliseconds_int(integer()) -> binary().
milliseconds_int(N) ->
_pipe = {milliseconds, gleam@int:to_float(N)},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec seconds_float(float()) -> binary().
seconds_float(N) ->
_pipe = {seconds, N},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec seconds_int(integer()) -> binary().
seconds_int(N) ->
_pipe = {seconds, gleam@int:to_float(N)},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec hours_float(float()) -> binary().
hours_float(N) ->
_pipe = {hours, N},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec hours_int(integer()) -> binary().
hours_int(N) ->
_pipe = {hours, gleam@int:to_float(N)},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec days_float(float()) -> binary().
days_float(N) ->
_pipe = {days, N},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec days_int(integer()) -> binary().
days_int(N) ->
_pipe = {days, gleam@int:to_float(N)},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec weeks_float(float()) -> binary().
weeks_float(N) ->
_pipe = {weeks, N},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec weeks_int(integer()) -> binary().
weeks_int(N) ->
_pipe = {weeks, gleam@int:to_float(N)},
_pipe@1 = humanise@time:humanise(_pipe),
humanise@time:to_string(_pipe@1).
-spec bytes_float(float()) -> binary().
bytes_float(N) ->
_pipe = {bytes, N},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec bytes_int(integer()) -> binary().
bytes_int(N) ->
_pipe = {bytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec kilobytes_float(float()) -> binary().
kilobytes_float(N) ->
_pipe = {kilobytes, N},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec kilobytes_int(integer()) -> binary().
kilobytes_int(N) ->
_pipe = {kilobytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec megabytes_float(float()) -> binary().
megabytes_float(N) ->
_pipe = {megabytes, N},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec megabytes_int(integer()) -> binary().
megabytes_int(N) ->
_pipe = {megabytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec gigabytes_float(float()) -> binary().
gigabytes_float(N) ->
_pipe = {gigabytes, N},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec gigabytes_int(integer()) -> binary().
gigabytes_int(N) ->
_pipe = {gigabytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec terabytes_float(float()) -> binary().
terabytes_float(N) ->
_pipe = {terabytes, N},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec terabytes_int(integer()) -> binary().
terabytes_int(N) ->
_pipe = {terabytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes:humanise(_pipe),
humanise@bytes:to_string(_pipe@1).
-spec kibibytes_float(float()) -> binary().
kibibytes_float(N) ->
_pipe = {kibibytes, N},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec kibibytes_int(integer()) -> binary().
kibibytes_int(N) ->
_pipe = {kibibytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec mebibytes_float(float()) -> binary().
mebibytes_float(N) ->
_pipe = {mebibytes, N},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec mebibytes_int(integer()) -> binary().
mebibytes_int(N) ->
_pipe = {mebibytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec gibibytes_float(float()) -> binary().
gibibytes_float(N) ->
_pipe = {gibibytes, N},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec gibibytes_int(integer()) -> binary().
gibibytes_int(N) ->
_pipe = {gibibytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec tebibytes_float(float()) -> binary().
tebibytes_float(N) ->
_pipe = {tebibytes, N},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).
-spec tebibytes_int(integer()) -> binary().
tebibytes_int(N) ->
_pipe = {tebibytes, gleam@int:to_float(N)},
_pipe@1 = humanise@bytes1024:humanise(_pipe),
humanise@bytes1024:to_string(_pipe@1).