Cldr.Number.Parser.resolve_per

You're seeing just the function resolve_per, go back to Cldr.Number.Parser module for more information.
Link to this function

resolve_per(string, options \\ [])

View Source (since 2.21.0)

Specs

resolve_per(String.t(), Keyword.t()) ::
  per() | [per() | String.t()] | {:error, {module(), String.t()}}

Resolve and tokenize percent or permille from the beginning and/or the end of a string

Arguments

  • list is any list in which percent and permille symbols are expected

  • options is a keyword list of options

Options

Returns

  • An :percent or permille or

  • {:error, {exception, message}}

Examples

iex> Cldr.Number.Parser.resolve_per "11%"
["11", :percent]

iex> Cldr.Number.Parser.resolve_per "% of linguists"
[:percent, " of linguists"]

iex> Cldr.Number.Parser.resolve_per "% of linguists %"
[:percent, " of linguists ", :percent]