Added in API level 30

RangeIdentityFallback


class RangeIdentityFallback
kotlin.Any
   ↳ kotlin.Enum<android.icu.number.NumberRangeFormatter.RangeIdentityFallback>
   ↳ android.icu.number.NumberRangeFormatter.RangeIdentityFallback

Defines the behavior when the two numbers in the range are identical after rounding. To programmatically detect when the identity fallback is used, compare the lower and upper BigDecimals via FormattedNumber.

Summary

Enum values

Show the number using a locale-sensitive approximation pattern.

Show the number using a locale-sensitive approximation pattern.

Show the number as the range of two equal values.

Show the number as a single value rather than a range.

Enum values

APPROXIMATELY

Added in API level 30
enum val APPROXIMATELY : NumberRangeFormatter.RangeIdentityFallback

Show the number using a locale-sensitive approximation pattern. Use the range pattern always, even if the inputs are the same. Example: "~$5"

APPROXIMATELY_OR_SINGLE_VALUE

Added in API level 30
enum val APPROXIMATELY_OR_SINGLE_VALUE : NumberRangeFormatter.RangeIdentityFallback

Show the number using a locale-sensitive approximation pattern. If the numbers were the same before rounding, show the single value. Example: "~$5" or "$5"

RANGE

Added in API level 30
enum val RANGE : NumberRangeFormatter.RangeIdentityFallback

Show the number as the range of two equal values. Use the range pattern always, even if the inputs are the same. Example (with RangeCollapse.NONE): "$5 – $5"

SINGLE_VALUE

Added in API level 30
enum val SINGLE_VALUE : NumberRangeFormatter.RangeIdentityFallback

Show the number as a single value rather than a range. Example: "$5"