Exoddic v1.0.1 Exoddic
A means for working with odds and probability.
In particular, a means to convert between different representations.
Summary
Types
A keyword list with conversion options
Functions
convert values among the various supported odds formats
Types
exoddic_options :: [from: atom, to: atom, for_display: boolean]
A keyword list with conversion options
from
: the supplied formatto
: the desired formatfor_display
: whether to nicely format the output as a string
Functions
Specs
convert(number | String.t, exoddic_options) ::
String.t |
number
convert values among the various supported odds formats.
The to
and from
formats are identified by atoms corresponding to
the converter module names.
Conversion amounts provided as strings will receive a best effort attempt at conversion to an appropriate number.
for_display
defaults to true and will return an appropriately formatted string for the
requested item. If set to false, it will return an unformatted number.