DistanceText
Displays a formatted distance as text, adapting to the specified locale, unit system, and format style.
This composable renders a textual representation of a given distance value, with options for different units, formats, locales, and text styles. It automatically adjusts the level of accuracy based on the specified format, showing a user-friendly, concise distance.
Parameters
The Distance value to be displayed.
Modifier to be applied to the underlying Text
element.
Defines the format style for the distance text.
DistanceFormat.Long: Displays in a detailed format (e.g., "10 miles", "5 feet", "6 meters").
DistanceFormat.Short: Displays in a concise format (e.g., "10 mi", "5 ft", "6 m"). This setting determines the highest level of accuracy, e.g., converting "2500 cm" to "2.5 m".
The Locale to use for determining language and unit system (imperial or metric). Defaults to the current locale.
The DistanceUnit for the distance representation. By default, it is auto-selected based on the specified or current locale.
Text style applied to the Text
element displaying the distance.
Displays a formatted distance as text, adapting to the specified language, unit system, and format style.
This composable renders a textual representation of a given distance value, with options for different units, formats, locales, and text styles. It automatically adjusts the level of accuracy based on the specified format, showing a user-friendly, concise distance.
Parameters
The Distance value to be displayed.
The DistanceUnit for the distance representation.
The ISO 639 compliant language code to use for determining unit system.
Modifier to be applied to the underlying Text
element.
Defines the format style for the distance text.
DistanceFormat.Long: Displays in a detailed format (e.g., "10 miles", "5 feet", "6 meters").
DistanceFormat.Short: Displays in a concise format (e.g., "10 mi", "5 ft", "6 m"). This setting determines the highest level of accuracy, e.g., converting "2500 cm" to "2.5 m".
Text style applied to the Text
element displaying the distance.