IntlHelpers

Platform-specific Intl helper functions. These are implemented via expect/actual in platform-specific sources.

Functions

Link copied to clipboard
fun formatDate(value: Long, locale: LanguageIdentifier, memoizer: IntlLangMemoizer, style: String = "medium", timeZone: String? = null): String?

Format a date only.

Link copied to clipboard
fun formatDateTime(value: Long, locale: LanguageIdentifier, memoizer: IntlLangMemoizer, dateStyle: String? = null, timeStyle: String? = null, hour12: Boolean? = null, timeZone: String? = null): String?
Link copied to clipboard
fun formatList(values: List<String>, locale: LanguageIdentifier, memoizer: IntlLangMemoizer, type: String = "conjunction", style: String = "long"): String?

Format a list with locale-aware conjunction/disjunction.

Link copied to clipboard
fun formatNumber(value: Double, locale: LanguageIdentifier, memoizer: IntlLangMemoizer, style: String? = null, currency: String? = null, currencyDisplay: String? = null, minimumFractionDigits: Int? = null, maximumFractionDigits: Int? = null, useGrouping: Boolean? = null): String?
Link copied to clipboard
fun formatTime(value: Long, locale: LanguageIdentifier, memoizer: IntlLangMemoizer, style: String = "medium", hour12: Boolean? = null, timeZone: String? = null): String?

Format a time only.

Link copied to clipboard

Get ordinal plural category (e.g. "one" for 1st, "two" for 2nd, "few" for 3rd, "other" otherwise) for a number in a given locale.

Link copied to clipboard

Get plural category for a number in a given locale.