DurationNaturalLanguageX extension
Alternative duration formatting for human-readable UI copy.
Complements HumanizedDuration with two additional formats:
- toNaturalString — word-based, top-2 units:
"1 hour 2 minutes" - toCompactString — abbreviated top-2 units:
"1h 2m" - toDetailedString — abbreviated with milliseconds:
"1m 0s 500ms"
- on
Methods
-
toCompactString(
) → String -
Available on Duration, provided by the DurationNaturalLanguageX extension
Short compact form showing the two most significant non-zero units. -
toDetailedString(
) → String -
Available on Duration, provided by the DurationNaturalLanguageX extension
Abbreviated breakdown including milliseconds. -
toNaturalString(
) → String -
Available on Duration, provided by the DurationNaturalLanguageX extension
Natural-language description using the two largest non-zero units.