Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter#inhmethods)

# LocalizedNumberRangeFormatter

*** ** * ** ***


`
public


class
LocalizedNumberRangeFormatter
`


`


`

`

extends https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings<https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter>


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.icu.number.NumberRangeFormatterSettings](https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings)\<[android.icu.number.LocalizedNumberRangeFormatter](https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter)\> ||
|   | ↳ | android.icu.number.LocalizedNumberRangeFormatter |

<br />

*** ** * ** ***

A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.

Instances of this class are immutable and thread-safe.
**See also:**

- `https://developer.android.com/reference/android/icu/number/NumberRangeFormatter`

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/icu/number/FormattedNumberRange` | ` https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter#formatRange(int,%20int)(int first, int second) ` Format the given integers to a string using the settings specified in the NumberRangeFormatter fluent setting chain. |
| ` https://developer.android.com/reference/android/icu/number/FormattedNumberRange` | ` https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter#formatRange(java.lang.Number,%20java.lang.Number)(https://developer.android.com/reference/java/lang/Number first, https://developer.android.com/reference/java/lang/Number second) ` Format the given Numbers to a string using the settings specified in the NumberRangeFormatter fluent setting chain. |
| ` https://developer.android.com/reference/android/icu/number/FormattedNumberRange` | ` https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter#formatRange(double,%20double)(double first, double second) ` Format the given doubles to a string using the settings specified in the NumberRangeFormatter fluent setting chain. |
| ` https://developer.android.com/reference/android/icu/number/UnlocalizedNumberRangeFormatter` | ` https://developer.android.com/reference/android/icu/number/LocalizedNumberRangeFormatter#withoutLocale()() ` Disassociate the locale from this formatter. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings ` |---|---| | ` T` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#collapse(android.icu.number.NumberRangeFormatter.RangeCollapse)(https://developer.android.com/reference/android/icu/number/NumberRangeFormatter.RangeCollapse collapse) ` Sets the aggressiveness of "collapsing" fields across the range separator. | | ` boolean` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object other) ` Indicates whether some other object is "equal to" this one. | | ` int` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#hashCode()() ` Returns a hash code value for the object. | | ` T` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#identityFallback(android.icu.number.NumberRangeFormatter.RangeIdentityFallback)(https://developer.android.com/reference/android/icu/number/NumberRangeFormatter.RangeIdentityFallback identityFallback) ` Sets the behavior when the two sides of the range are the same. | | ` T` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#numberFormatterBoth(android.icu.number.UnlocalizedNumberFormatter)(https://developer.android.com/reference/android/icu/number/UnlocalizedNumberFormatter formatter) ` Sets the NumberFormatter instance to use for the numbers in the range. | | ` T` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#numberFormatterFirst(android.icu.number.UnlocalizedNumberFormatter)(https://developer.android.com/reference/android/icu/number/UnlocalizedNumberFormatter formatterFirst) ` Sets the NumberFormatter instance to use for the first number in the range. | | ` T` | ` https://developer.android.com/reference/android/icu/number/NumberRangeFormatterSettings#numberFormatterSecond(android.icu.number.UnlocalizedNumberFormatter)(https://developer.android.com/reference/android/icu/number/UnlocalizedNumberFormatter formatterSecond) ` Sets the NumberFormatter instances to use for the second number in the range. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### formatRange

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FormattedNumberRange formatRange (int first, 
                int second)
```

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

<br />

| Parameters ||
|---|---|
| `first` | `int`: The first number in the range, usually to the left in LTR locales. <br /> |
| `second` | `int`: The second number in the range, usually to the right in LTR locales. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/number/FormattedNumberRange` | A FormattedNumberRange object; call .toString() to get the string. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/number/NumberRangeFormatter`

### formatRange

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FormattedNumberRange formatRange (Number first, 
                Number second)
```

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

<br />

| Parameters ||
|---|---|
| `first` | `Number`: The first number in the range, usually to the left in LTR locales. <br /> |
| `second` | `Number`: The second number in the range, usually to the right in LTR locales. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/number/FormattedNumberRange` | A FormattedNumberRange object; call .toString() to get the string. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if first or second is null |

**See also:**

- `https://developer.android.com/reference/android/icu/number/NumberRangeFormatter`

### formatRange

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FormattedNumberRange formatRange (double first, 
                double second)
```

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

<br />

| Parameters ||
|---|---|
| `first` | `double`: The first number in the range, usually to the left in LTR locales. <br /> |
| `second` | `double`: The second number in the range, usually to the right in LTR locales. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/number/FormattedNumberRange` | A FormattedNumberRange object; call .toString() to get the string. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/number/NumberRangeFormatter`

### withoutLocale

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public UnlocalizedNumberRangeFormatter withoutLocale ()
```

Disassociate the locale from this formatter.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/number/UnlocalizedNumberRangeFormatter` | The fluent chain. <br /> |