Soundboard.Volume (soundboard v1.7.0)

Helpers for working with volume percentages and decimal ratios.

Summary

Types

percent()

@type percent() :: 0..150

Functions

clamp_percent(value)

@spec clamp_percent(number()) :: percent()

decimal_to_percent(decimal)

@spec decimal_to_percent(number() | nil) :: percent()

normalize_percent(value, default_percent)

@spec normalize_percent(String.t() | number() | nil, percent()) :: percent()

percent_to_decimal(percent)

@spec percent_to_decimal(String.t() | number() | nil) :: float()

percent_to_decimal(value, default_percent)

@spec percent_to_decimal(String.t() | number() | nil, percent()) :: float()