Skip to content

Money version 3.2.4

Compare
Choose a tag to compare
@kipcole9 kipcole9 released this 13 Feb 11:25

Bug Fixes

Enhancements

  • Adds a :fuzzy option to Money.parse/2 that uses String.jaro_distance/2 to help determine if the provided currency text can be resolved as a currency code. For example:
  iex> Money.parse("100 eurosports", fuzzy: 0.8)
  #Money<:EUR, 100>

  iex> Money.parse("100 eurosports", fuzzy: 0.9)
  {:error,
   {Money.Invalid, "Unable to create money from \"eurosports\" and \"100\""}}