-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Trying to create a new Unit<Frequency>
RPM:
@Test
void myRpmUnit() throws IOException {
Unit<Frequency> RPM = AlternateUnit.of(ONE.divide(MINUTE), "rpm").asType(Frequency.class);
Quantity<Frequency> quantity = Quantities.getQuantity(60, RPM);
assertThat(quantity.to(HERTZ).getValue().doubleValue()).isEqualTo(1.0);
}
Specifying alternate as "rpm" I get:
java.lang.IllegalArgumentException: The parent unit: 1/min is not an unscaled SI unit
The RPM unit should have the symbol "rpm" (or "[rpm]"?) instead of 1/min. This should work in serialization and deserialization.
Tried using:
SimpleUnitFormat.getInstance().label(RPM, "rpm");
... but this works only partially: using toString() it writes "rpm", but using Jackson serialization we still get 1/min.
Using indriya 2.0.4
Metadata
Metadata
Assignees
Labels
No labels