JS.Intl.NumberFormat
- Package
- purescript-js-intl
- Repository
- pete-murphy/purescript-js-intl
#NumberFormat Source
data NumberFormat
Language-sensitive number formatting
#NumberFormatOptions Source
type NumberFormatOptions :: Row Type
type NumberFormatOptions = (compactDisplay :: String, currency :: String, currencyDisplay :: String, currencySign :: String, localeMatcher :: String, maximumFractionDigits :: Int, maximumSignificantDigits :: Int, minimumFractionDigits :: Int, minimumIntegerDigits :: Int, minimumSignificantDigits :: Int, notation :: String, numberingSystem :: String, roundingIncrement :: Int, roundingMode :: String, roundingPriority :: String, signDisplay :: String, style :: String, trailingZeroDisplay :: String, unit :: String, unitDisplay :: String, useGrouping :: Foreign)
Options to pass to the NumberFormat
constructor (new
or new_
)
Note: Not all combinations of options are valid. See the specification (https://tc39.es/ecma402/#sec-intl.numberformat) or the MDN reference (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat)
#ToNumberFormatOptions Source
data ToNumberFormatOptions
Instances
ConvertOption ToNumberFormatOptions "localeMatcher" LocaleMatcher String
ConvertOption ToNumberFormatOptions "localeMatcher" String String
ConvertOption ToNumberFormatOptions "numberingSystem" String String
ConvertOption ToNumberFormatOptions "compactDisplay" CompactDisplay String
ConvertOption ToNumberFormatOptions "compactDisplay" String String
ConvertOption ToNumberFormatOptions "style" NumberFormatStyle String
ConvertOption ToNumberFormatOptions "style" String String
ConvertOption ToNumberFormatOptions "currency" String String
ConvertOption ToNumberFormatOptions "currencyDisplay" CurrencyDisplay String
ConvertOption ToNumberFormatOptions "currencyDisplay" String String
ConvertOption ToNumberFormatOptions "currencySign" CurrencySign String
ConvertOption ToNumberFormatOptions "currencySign" String String
ConvertOption ToNumberFormatOptions "notation" Notation String
ConvertOption ToNumberFormatOptions "notation" String String
ConvertOption ToNumberFormatOptions "signDisplay" SignDisplay String
ConvertOption ToNumberFormatOptions "signDisplay" String String
ConvertOption ToNumberFormatOptions "unit" DurationComponent String
ConvertOption ToNumberFormatOptions "unit" String String
ConvertOption ToNumberFormatOptions "unitDisplay" UnitDisplay String
ConvertOption ToNumberFormatOptions "unitDisplay" String String
ConvertOption ToNumberFormatOptions "useGrouping" UseGrouping Foreign
ConvertOption ToNumberFormatOptions "useGrouping" String Foreign
ConvertOption ToNumberFormatOptions "useGrouping" Boolean Foreign
ConvertOption ToNumberFormatOptions "useGrouping" Foreign Foreign
ConvertOption ToNumberFormatOptions "roundingMode" RoundingMode String
ConvertOption ToNumberFormatOptions "roundingMode" String String
ConvertOption ToNumberFormatOptions "roundingIncrement" RoundingIncrement Int
ConvertOption ToNumberFormatOptions "roundingIncrement" Int Int
ConvertOption ToNumberFormatOptions "roundingPriority" RoundingPriority String
ConvertOption ToNumberFormatOptions "roundingPriority" String String
ConvertOption ToNumberFormatOptions "trailingZeroDisplay" TrailingZeroDisplay String
ConvertOption ToNumberFormatOptions "trailingZeroDisplay" String String
ConvertOption ToNumberFormatOptions "minimumIntegerDigits" Int Int
ConvertOption ToNumberFormatOptions "minimumFractionDigits" Int Int
ConvertOption ToNumberFormatOptions "maximumFractionDigits" Int Int
ConvertOption ToNumberFormatOptions "minimumSignificantDigits" Int Int
ConvertOption ToNumberFormatOptions "maximumSignificantDigits" Int Int
#new Source
new :: forall provided. ConvertOptionsWithDefaults ToNumberFormatOptions (Record NumberFormatOptions) (Record provided) (Record NumberFormatOptions) => Array Locale -> Record provided -> Effect NumberFormat
#supportedLocalesOf Source
supportedLocalesOf :: forall provided. ConvertOptionsWithDefaults ToNumberFormatOptions (Record NumberFormatOptions) (Record provided) (Record NumberFormatOptions) => Array Locale -> Record provided -> Array String
#format Source
format :: NumberFormat -> Number -> String
Formats a number according to the locale and formatting options of the
NumberFormat
#formatRange Source
formatRange :: NumberFormat -> Number -> Number -> String
Formats a range of numbers according to the locale and formatting options
of the NumberFormat
#formatRangeToParts Source
formatRangeToParts :: NumberFormat -> Number -> Number -> Array { type :: String, value :: String }
Returns an array of objects containing the locale-specific tokens from which it is possible to build custom strings while preserving the locale-specific parts
#formatToParts Source
formatToParts :: NumberFormat -> Number -> Array { type :: String, value :: String }
Allows locale-aware formatting of strings produced by the NumberFormat
#convertOptionsWithDefaults Source
convertOptionsWithDefaults :: forall provided all. ConvertOptionsWithDefaults ToNumberFormatOptions (Record NumberFormatOptions) provided all => provided -> all
- Modules
- JS.
Intl - JS.
Intl. Collator - JS.
Intl. DateTimeFormat - JS.
Intl. DisplayNames - JS.
Intl. ListFormat - JS.
Intl. Locale - JS.
Intl. NumberFormat - JS.
Intl. Options. AvailableCanonical - JS.
Intl. Options. CaseFirst - JS.
Intl. Options. Collation - JS.
Intl. Options. CompactDisplay - JS.
Intl. Options. CurrencyDisplay - JS.
Intl. Options. CurrencySign - JS.
Intl. Options. DateStyle - JS.
Intl. Options. Day - JS.
Intl. Options. DayPeriod - JS.
Intl. Options. DisplayNamesType - JS.
Intl. Options. Era - JS.
Intl. Options. Fallback - JS.
Intl. Options. FormatMatcher - JS.
Intl. Options. Granularity - JS.
Intl. Options. Hour - JS.
Intl. Options. HourCycle - JS.
Intl. Options. Internal. Unsafe - JS.
Intl. Options. LanguageDisplay - JS.
Intl. Options. ListFormatType - JS.
Intl. Options. LocaleMatcher - JS.
Intl. Options. Minute - JS.
Intl. Options. Month - JS.
Intl. Options. Notation - JS.
Intl. Options. NumberFormatStyle - JS.
Intl. Options. Numeric - JS.
Intl. Options. PluralCategory - JS.
Intl. Options. PluralRulesType - JS.
Intl. Options. RelativeTimeUnit - JS.
Intl. Options. RoundingIncrement - JS.
Intl. Options. RoundingMode - JS.
Intl. Options. RoundingPriority - JS.
Intl. Options. Second - JS.
Intl. Options. Sensitivity - JS.
Intl. Options. SignDisplay - JS.
Intl. Options. Style - JS.
Intl. Options. TimeStyle - JS.
Intl. Options. TimeZoneName - JS.
Intl. Options. TrailingZeroDisplay - JS.
Intl. Options. UnitDisplay - JS.
Intl. Options. Usage - JS.
Intl. Options. UseGrouping - JS.
Intl. Options. Weekday - JS.
Intl. Options. Year - JS.
Intl. PluralRules - JS.
Intl. RelativeTimeFormat - JS.
Intl. Segmenter - JS.
LocaleSensitive. Date - JS.
LocaleSensitive. Number - JS.
LocaleSensitive. String