AmountFormats

Provides the ability to format a temporal amount.

This allows a TemporalAmount, such as Duration or Period, to be formatted. Only selected formatting options are provided.

Implementation Requirements:

This class is immutable and thread-safe.

Types

Link copied to clipboard
fun interface IntPredicate

Functions

Link copied to clipboard
Link copied to clipboard
fun iso8601(period: Period, duration: Duration): String

Formats a period and duration to a string in ISO-8601 format.

Link copied to clipboard
fun parseUnitBasedDuration(durationText: CharSequence): Duration

Parses formatted durations based on units.

Link copied to clipboard
fun wordBased(duration: Duration, locale: Locale): String

Formats a duration to a string in a localized word-based format.

fun wordBased(period: Period, locale: Locale): String

Formats a period to a string in a localized word-based format.

fun wordBased(period: Period, duration: Duration, locale: Locale): String

Formats a period and duration to a string in a localized word-based format.