View Source Exoddic (Exoddic v1.3.8)

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

@type exoddic_options() :: [from: atom(), to: atom(), for_display: boolean()]

A keyword list with conversion options

The to and from formats are identified by atoms corresponding to the converter module names. They default to :prob

  • from: the supplied input format
  • to: the desired output format
  • for_display: whether to nicely format the output as a string, defaults to true

Functions

Link to this function

convert(amount, options \\ [])

View Source
@spec convert(number() | String.t(), exoddic_options()) :: String.t() | float()

Convert values among the various supported odds formats.

Conversion amounts provided as strings will receive a best effort attempt at conversion to an appropriate number.