Added in API level 30

LocalizedNumberRangeFormatter


open class LocalizedNumberRangeFormatter : NumberRangeFormatterSettings<LocalizedNumberRangeFormatter!>
kotlin.Any
   ↳ android.icu.number.NumberRangeFormatterSettings<android.icu.number.LocalizedNumberRangeFormatter>
   ↳ android.icu.number.LocalizedNumberRangeFormatter

A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available. Instances of this class are immutable and thread-safe.

Summary

Public methods
open FormattedNumberRange!
formatRange(first: Int, second: Int)

Format the given integers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

open FormattedNumberRange!
formatRange(first: Double, second: Double)

Format the given doubles to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

open FormattedNumberRange!
formatRange(first: Number!, second: Number!)

Format the given Numbers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

Inherited functions

Public methods

formatRange

Added in API level 30
open fun formatRange(
    first: Int,
    second: Int
): FormattedNumberRange!

Format the given integers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

Parameters
first Int: The first number in the range, usually to the left in LTR locales.
second Int: The second number in the range, usually to the right in LTR locales.
Return
FormattedNumberRange! A FormattedNumberRange object; call .toString() to get the string.

formatRange

Added in API level 30
open fun formatRange(
    first: Double,
    second: Double
): FormattedNumberRange!

Format the given doubles to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

Parameters
first Double: The first number in the range, usually to the left in LTR locales.
second Double: The second number in the range, usually to the right in LTR locales.
Return
FormattedNumberRange! A FormattedNumberRange object; call .toString() to get the string.

formatRange

Added in API level 30
open fun formatRange(
    first: Number!,
    second: Number!
): FormattedNumberRange!

Format the given Numbers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.

Parameters
first Number!: The first number in the range, usually to the left in LTR locales.
second Number!: The second number in the range, usually to the right in LTR locales.
Return
FormattedNumberRange! A FormattedNumberRange object; call .toString() to get the string.
Exceptions
java.lang.IllegalArgumentException if first or second is null