This simple package formats float numbers as pretty strings. It is
flexible enough to deal with different number of decimals, different thousand
separators and diffetent decimal separator.
Int numbers?>>> import Locales exposing (usLocale)
>>> format usLocale (toFloat 1234)
"1,234.00"
>>> import Locales exposing (usLocale)
>>> format { usLocale | decimals = 0 } <| toFloat 1234
"1,234"There are known
bugs in how Elm handles
large numbers. This library cannot work with large numbers (over 2 ^ 31)
until Elm itself is fixed:
>>> format usLocale 1e10
"1,410,065,408.00"
Format a float number as a pretty string: