Stay organized with collections
Save and categorize content based on your preferences.
RangeCollapse
class RangeCollapse
Defines how to merge fields that are identical across the range sign.
Summary
Enum values |
Collapse any field that is equal across the range sign.
|
Use locale data and heuristics to determine how much of the string to collapse.
|
Do not collapse any part of the number.
|
Collapse the unit part of the number, but not the notation, if present.
|
Enum values
ALL
enum val ALL : NumberRangeFormatter.RangeCollapse
Collapse any field that is equal across the range sign. May introduce ambiguity on the magnitude of the number. Example: "3.2 – 5.3 thousand kilograms"
AUTO
enum val AUTO : NumberRangeFormatter.RangeCollapse
Use locale data and heuristics to determine how much of the string to collapse. Could end up collapsing none, some, or all repeated pieces in a locale-sensitive way.
The heuristics used for this option are subject to change over time.
UNIT
enum val UNIT : NumberRangeFormatter.RangeCollapse
Collapse the unit part of the number, but not the notation, if present. Example: "3.2 thousand – 5.3 thousand kilograms"
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.RangeCollapse\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRangeCollapse\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/number/NumberRangeFormatter.RangeCollapse \"View this page in Java\") \n\n```\nclass RangeCollapse\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.RangeCollapse](#)\\\u003e ||\n| | ↳ | [android.icu.number.NumberRangeFormatter.RangeCollapse](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [NumberRangeFormatter.RangeCollapse.ALL](#ENUM_VALUE:ALL), [NumberRangeFormatter.RangeCollapse.AUTO](#ENUM_VALUE:AUTO), [NumberRangeFormatter.RangeCollapse.NONE](#ENUM_VALUE:NONE), [NumberRangeFormatter.RangeCollapse.UNIT](#ENUM_VALUE:UNIT) |-------------------------------------------------------------|---------------------------------------------------------------------------------| | [NumberRangeFormatter.RangeCollapse.ALL](#ENUM_VALUE:ALL) | Collapse any field that is equal across the range sign. | | [NumberRangeFormatter.RangeCollapse.AUTO](#ENUM_VALUE:AUTO) | Use locale data and heuristics to determine how much of the string to collapse. | | [NumberRangeFormatter.RangeCollapse.NONE](#ENUM_VALUE:NONE) | Do not collapse any part of the number. | | [NumberRangeFormatter.RangeCollapse.UNIT](#ENUM_VALUE:UNIT) | Collapse the unit part of the number, but not the notation, if present. | |\n\nDefines how to merge fields that are identical across the range sign.\n\nSummary\n-------\n\n| Enum values ||\n|----------------------------------------------------------------------------------------------------------|---|\n| [ALL](#ENUM_VALUE:ALL) Collapse any field that is equal across the range sign. |\n| [AUTO](#ENUM_VALUE:AUTO) Use locale data and heuristics to determine how much of the string to collapse. |\n| [NONE](#ENUM_VALUE:NONE) Do not collapse any part of the number. |\n| [UNIT](#ENUM_VALUE:UNIT) Collapse the unit part of the number, but not the notation, if present. |\n\nEnum values\n-----------\n\n### ALL\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val ALL : NumberRangeFormatter.RangeCollapse\n```\n\nCollapse any field that is equal across the range sign. May introduce ambiguity on the magnitude of the number. Example: \"3.2 -- 5.3 thousand kilograms\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter) \n\n### AUTO\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val AUTO : NumberRangeFormatter.RangeCollapse\n```\n\nUse locale data and heuristics to determine how much of the string to collapse. Could end up collapsing none, some, or all repeated pieces in a locale-sensitive way.\n\nThe heuristics used for this option are subject to change over time. \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter) \n\n### NONE\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val NONE : NumberRangeFormatter.RangeCollapse\n```\n\nDo not collapse any part of the number. Example: \"3.2 thousand kilograms -- 5.3 thousand kilograms\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter) \n\n### UNIT\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val UNIT : NumberRangeFormatter.RangeCollapse\n```\n\nCollapse the unit part of the number, but not the notation, if present. Example: \"3.2 thousand -- 5.3 thousand kilograms\" \n**See Also**\n\n- [android.icu.number.NumberRangeFormatter](/reference/kotlin/android/icu/number/NumberRangeFormatter)"]]