Cldr.Unit.to_iolist-exclamation-mark

You're seeing just the function to_iolist-exclamation-mark, go back to Cldr.Unit module for more information.

Specs

to_iolist!(list_or_number :: value() | t() | [t()]) :: list() | no_return()

Formats a number into an iolist according to a unit definition for the current process's locale and backend or raises on error.

The curent process's locale is set with Cldr.put_locale/1.

See Cldr.Unit.to_iolist!/3 for full details.

Link to this function

to_iolist!(unit, backend, options \\ [])

View Source

Specs

to_iolist!(value() | t(), Cldr.backend() | Keyword.t(), Keyword.t()) ::
  list() | no_return()

Formats a number into an iolist according to a unit definition for the current process's locale and backend or raises on error.

During processing any :format_options of a t:Cldr.Unit are merged with options with options taking precedence.

Arguments

  • number is any number (integer, float or Decimal) or a t:Cldr.Unit struct

  • backend is any module that includes use Cldr and therefore is a Cldr backend module. The default is Cldr.default_backend!/0.

  • options is a keyword list

Options

Returns

  • io_list or

  • raises an exception

Examples

iex> Cldr.Unit.to_iolist! Cldr.Unit.new!(:gallon, 123), MyApp.Cldr
["123", " gallons"]