coinop-logan / elm-format-number / FormatNumber.Locales

These locales and its names are based on this International Language Environments Guide


type alias Locale =
{ decimals : Basics.Int
, thousandSeparator : String
, decimalSeparator : String
, negativePrefix : String
, negativeSuffix : String
, positivePrefix : String
, positiveSuffix : String 
}

This is the Locale type and constructor.

Pre-defined locales

frenchLocale : Locale

Locale used in France, Canada, Finland and Sweden. It has 3 decimals digits, uses a thin space (U+202F) as thousand separator and a , as decimal separator. It uses a minus sign (not a hyphen) as a prefix for negative numbers, but no sufix or prefix for positive numbers.

spanishLocale : Locale

Locale used in Spain, Italy and Norway. It has 3 decimals digits, uses a . as thousand separator and a , as decimal separator. It uses a minus sign (not a hyphen) as a prefix for negative numbers, but no sufix or prefix for positive numbers.

usLocale : Locale

Locale used in the United States, Great Britain and Thailand. It has 2 decimals digits, uses a , as thousand separator and a . as decimal separator. It uses a minus sign (not a hyphen) as a prefix for negative numbers, no sufix or prefix for positive numbers.