I'm not overly familiar with this ecosystem, but it strikes me that tech.units.indriya.AbstractUnit.prefix() always results in a PowerOfIntConverter via MultiplyConverter.ofPrefix() (same as MultiplyConverter.ofExponent()). Which by luck is how I constructed the unit I was using.
I defined
seconds * 10^-5
and it serializes weird.I expected perhaps
"s/100000"
or"s.10^-5"
. The UCUMFormat'ers all produce"s.0"
."s.0"
"s.0"
"s.0"
"s·10^-5"
Here is a test to recreate the potential issue.
I'm not overly familiar with this ecosystem, but it strikes me that
tech.units.indriya.AbstractUnit.prefix()
always results in a PowerOfIntConverter viaMultiplyConverter.ofPrefix()
(same asMultiplyConverter.ofExponent()
). Which by luck is how I constructed the unit I was using.Should
MultiplyConverter.ofPrefix()
sometimes result in a RationalConverter instead? Or should additional logic be included inUCUMConverterFormatter.formatConverter()
? It seems it already handles this scenario for RationalConverter.If we can find a good path to resolve this, I'm happy to draft a PR. Cheers!