unitsofmeasurement/indriya

Compound Formatting

keilw opened this issue · 2 comments

keilw commented

Based on the vote in #17 and the EDR Hangout, we intend to go for a formatting option of "compound" quantities like "6 ft, 10 in".
The current QuantityFormat implementation is called SimpleQuantityFormat like the traditional Date/Time formatter classes in the JDK, but if another implementation specific to compound quantities like CompoundQuantityFormat was a better option, the name or number of implementing classes may change.

Requires #17

keilw commented

Human-Readable-Time-Specifications in Taurus test automation tool are somewhat comparable. E.g. 1d 2h 3m 4s = 93784 seconds. Of course unlike Taurus, java.time or Typesafe Config we have to cover a wide range of quantities, not just Time or a few others.

keilw commented

Wolfram also has a concept for that, MixedUnit and MixedMagnitude (where we use a Number)
https://reference.wolfram.com/language/ref/MixedUnit.html
The MixedUnit is very close to what JSR 275 had in mind with the CompoundUnit.