Cldr.Number.to_approx_string

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

to_approx_string(number, backend \\ default_backend(), options \\ [])

View Source

Specs

to_approx_string(number() | Decimal.t(), Cldr.backend(), Keyword.t() | map()) ::
  {:ok, String.t()} | {:error, {module(), String.t()}}

Formats a number and applies the :approximately format for a locale and number system.

Arguments

  • number is an integer, float or Decimal to be formatted

  • backend is any Cldr backend. That is, any module that contains use Cldr

  • options is a keyword list defining how the number is to be formatted. See Cldr.Number.to_string/3 for a description of the available options.

Example

iex> Cldr.Number.to_approx_string 1234, TestBackend.Cldr
{:ok, "~1,234"}