The idea here is to say that you want to format "road distance", and have the correct unit chosen based on the locale and scale.
I had an initial idea on how this could be implemented: simply add another setter to NumberFormatter like this:
Semantics: The regular "unit" setter turns into specifying the input unit; the output unit is the same as the input unit if unitContext is not specified, and the output unit could change if unitContext is specified.
We could decide whether or not to move forward with an API that directly returns the resolved unit, rather than putting it all in the formatter.
The unit preference IDs are already in CLDR data.
Moving this to "future" because this is blocked by the CLDR design.
We can probably close this ticket soon: as soon as it’s no longer guaranteed that a commit referencing this ticket will be in ICU 68, we should associate with new tickets instead. (Something not successfully cherry-picked into 68 must not be associated with this ticket.)
Closing as Fixed. If there are any remaining changes for ICU 68, we can temporarily re-open this ticket, or submit the fix in a follow-up ticket.
Asking because the ticket description + comments didn’t clear it up, is this already usable currently with the latest ICU version?
Edit: answered it myself, it was introduced in ICU 68 http://site.icu-project.org/download/68. Use it on Java like this: