Stay organized with collections
Save and categorize content based on your preferences.
RangeIdentityFallback
class 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
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
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
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"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# NumberRangeFormatter.RangeIdentityFallback\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRangeIdentityFallback\n=====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/number/NumberRangeFormatter.RangeIdentityFallback \"View this page in Java\") \n\n```\nclass RangeIdentityFallback\n```\n\n|---|---|--------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.icu.number.NumberRangeFormatter.RangeIdentityFallback](#)\\\u003e ||\n| | ↳ | [android.icu.number.NumberRangeFormatter.RangeIdentityFallback](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [NumberRangeFormatter.RangeIdentityFallback.APPROXIMATELY](#ENUM_VALUE:APPROXIMATELY), [NumberRangeFormatter.RangeIdentityFallback.APPROXIMATELY_OR_SINGLE_VALUE](#ENUM_VALUE:APPROXIMATELY_OR_SINGLE_VALUE), [NumberRangeFormatter.RangeIdentityFallback.RANGE](#ENUM_VALUE:RANGE), [NumberRangeFormatter.RangeIdentityFallback.SINGLE_VALUE](#ENUM_VALUE:SINGLE_VALUE) |-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| | [NumberRangeFormatter.RangeIdentityFallback.APPROXIMATELY](#ENUM_VALUE:APPROXIMATELY) | Show the number using a locale-sensitive approximation pattern. | | [NumberRangeFormatter.RangeIdentityFallback.APPROXIMATELY_OR_SINGLE_VALUE](#ENUM_VALUE:APPROXIMATELY_OR_SINGLE_VALUE) | Show the number using a locale-sensitive approximation pattern. | | [NumberRangeFormatter.RangeIdentityFallback.RANGE](#ENUM_VALUE:RANGE) | Show the number as the range of two equal values. | | [NumberRangeFormatter.RangeIdentityFallback.SINGLE_VALUE](#ENUM_VALUE:SINGLE_VALUE) | Show the number as a single value rather than a range. | |\n\nDefines 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.\n\nSummary\n-------\n\n| Enum values ||\n|--------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [APPROXIMATELY](#ENUM_VALUE:APPROXIMATELY) Show the number using a locale-sensitive approximation pattern. |\n| [APPROXIMATELY_OR_SINGLE_VALUE](#ENUM_VALUE:APPROXIMATELY_OR_SINGLE_VALUE) Show the number using a locale-sensitive approximation pattern. |\n| [RANGE](#ENUM_VALUE:RANGE) Show the number as the range of two equal values. |\n| [SINGLE_VALUE](#ENUM_VALUE:SINGLE_VALUE) Show the number as a single value rather than a range. |\n\nEnum values\n-----------\n\n### APPROXIMATELY\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val APPROXIMATELY : NumberRangeFormatter.RangeIdentityFallback\n```\n\nShow the number using a locale-sensitive approximation pattern. Use the range pattern always, even if the inputs are the same. Example: \"\\~$5\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter) \n\n### APPROXIMATELY_OR_SINGLE_VALUE\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val APPROXIMATELY_OR_SINGLE_VALUE : NumberRangeFormatter.RangeIdentityFallback\n```\n\nShow the number using a locale-sensitive approximation pattern. If the numbers were the same before rounding, show the single value. Example: \"\\~$5\" or \"$5\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter) \n\n### RANGE\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val RANGE : NumberRangeFormatter.RangeIdentityFallback\n```\n\nShow 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\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter) \n\n### SINGLE_VALUE\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val SINGLE_VALUE : NumberRangeFormatter.RangeIdentityFallback\n```\n\nShow the number as a single value rather than a range. Example: \"$5\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter)"]]