# Print output for @column tags ?> FormattedNumberRange - Android SDK | Android Developers

Most visited

Recently visited

FormattedNumberRange

public class FormattedNumberRange
extends Object implements CharSequence

java.lang.Object
   ↳ android.icu.number.FormattedNumberRange


The result of a number range formatting operation. This class allows the result to be exported in several data types, including a String, an AttributedCharacterIterator, and a BigDecimal. Instances of this class are immutable and thread-safe.

See also:

Summary

Public methods

BigDecimal getFirstBigDecimal()

Export the first formatted number as a BigDecimal.

NumberRangeFormatter.RangeIdentityResult getIdentityResult()

Returns whether the pair of numbers was successfully formatted as a range or whether an identity fallback was used.

BigDecimal getSecondBigDecimal()

Export the second formatted number as a BigDecimal.

AttributedCharacterIterator toCharacterIterator()

String toString()

Returns a string representation of the object.

Inherited methods

Public methods

getFirstBigDecimal

public BigDecimal getFirstBigDecimal ()

Export the first formatted number as a BigDecimal. This endpoint is useful for obtaining the exact number being printed after scaling and rounding have been applied by the number range formatting pipeline.

Returns
BigDecimal A BigDecimal representation of the first formatted number.

See also:

getIdentityResult

public NumberRangeFormatter.RangeIdentityResult getIdentityResult ()

Returns whether the pair of numbers was successfully formatted as a range or whether an identity fallback was used. For example, if the first and second number were the same either before or after rounding occurred, an identity fallback was used.

Returns
NumberRangeFormatter.RangeIdentityResult A RangeIdentityType indicating the resulting identity situation in the formatted number range.

See also:

getSecondBigDecimal

public BigDecimal getSecondBigDecimal ()

Export the second formatted number as a BigDecimal. This endpoint is useful for obtaining the exact number being printed after scaling and rounding have been applied by the number range formatting pipeline.

Returns
BigDecimal A BigDecimal representation of the second formatted number.

See also:

toCharacterIterator

public AttributedCharacterIterator toCharacterIterator ()

Returns
AttributedCharacterIterator

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.