You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
If we can find a good path to resolve this, I'm happy to draft a PR. Cheers!
The text was updated successfully, but these errors were encountered:
addict3d
changed the title
UCUMConverterFormatter unexpected serialization for transformed unit with negative exponent
UCUMConverterFormatter serializes seconds * 10^-5 weird
Jun 17, 2021
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!
The text was updated successfully, but these errors were encountered: