Money.Cldr.ellipsis
ellipsis
, go back to Money.Cldr module for more information.
Specs
Add locale-specific ellipsis to a string.
Arguments
string
is anyString.t
or a 2-element list ofString.t
between which the ellipsis is inserted.backend
is any module that includesuse Cldr
and therefore is aCldr
backend module. The default isCldr.default_backend!/0
. Note thatCldr.default_backend!/0
will raise an exception if no:default_backend
is configured under the:ex_cldr
key inconfig.exs
.options
is a keyword list of options
Options
:locale
is any valid locale name returned byCldr.known_locale_names/1
. The default isCldr.get_locale/0
.:location
determines where to place the ellipsis. The options are:after
(the default for a single string argument),:between
(the default and only valid location for an argument that is a list of two strings) and:before
.:format
formats based upon whether the ellipsis is inserted between words or sentences. The valid options are:word
or:sentence
. The default is:sentence
.
Examples
iex> Money.Cldr.ellipsis "And furthermore"
"And furthermore…"
iex> Money.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: "ja"
"And furthermore…there is much to be done"
iex> Money.Cldr.ellipsis "And furthermore", format: :word
"And furthermore …"
iex> Money.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: "ja", format: :word
"And furthermore … there is much to be done"