Convertion from m³ to hm³ always 0
I tried to convert by ByAbbreviation like this: UnitConverter.TryConvertByAbbreviation(2.03801051E+11, "Volume", "m³", "hm³", out double inHm3); or UnitConverter.TryConvertByAbbreviation(2.03801051E+11, "Volume", "m³", "km³", out double inHm3);
But the result is always 0.
I think the problem is when trying to find "km³" from the list, it always finds 2 items on the list
I have tried on v5 and v6, and it's the same result.
Can you help me, what should I do?
The problem is by design, they are ambiguous.
You'll have to convert unambiguous abbreviations, or specify the units explicitly in one of many ways: https://github.com/angularsen/UnitsNet#convert-quantity-to-unit---iquantity-and-enum
Hold on, I was too quick.
Kilocubicmeter and hectocubicmeter? This sounds very weird to me and I can't find much on Google on this.
It was added 8 years ago in a large PR adding a bunch of prefixes: https://github.com/angularsen/UnitsNet/pull/295 https://github.com/angularsen/UnitsNet/commit/b6e12fcf6a85b9cb86693615475792318466d27e#diff-cc4b6e795c97888da194c0f2d0bb93ead55d77d291604c18867d039019d2cd0cR29
It seems I questioned some related units back then: https://github.com/angularsen/UnitsNet/pull/295#issuecomment-334116738
kcf (thousand cubic feet), Kcm (Thousand Cubic meters) and KGal (thousand gallons)
And there was some evidence given that these were units actually used, albeit maybe not widely used.
Proposal
A) Remove Kilo and Hecto prefixes for Cubicmeter
or
B) Rename KiloCubicmeter => ThousandCubicmeter and HectoCubicmeter => HundredCubicmeter
I do find some references to names like thousands/hundreds like this: https://www.unitconverters.net/volume/hundred-cubic-foot-to-cubic-meter.htm https://www.kylesconverter.com/volume/thousand-cubic-meters-to-thousands-of-cubic-feet
@DInozemtsev You originally authored this, any insights 8 years later? 😄
Hi, I found these references on Wikipedia, but I'm unsure if these will help.
and it's really helpful if the symbol is also unique.
Maybe you can put a number like this as a symbol?
References: https://en.wikipedia.org/wiki/Cubic_metre and https://en.wikipedia.org/wiki/Litre#SI_prefixes_applied_to_the_litre
Yes, I forgot to include that in option B, but we would have to change the abbreviations to solve this issue. I think that's fair anyway, as these units seem very unstandard and their abbreviations conflict with very widely used units.
10³·m3 | ThousandCubicmeter
10²·m3 | HundredCubicmeter
I suggest using the · syntax for consistency with our guidelines: https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit#abbreviation-naming-conventions
Let's give the PR author a little time to chime in, but I think renaming these is the way to go and we have an opportunity in v6 that is still in prerelease. #1200
10³·m3 | ThousandCubicmeter10²·m3 | HundredCubicmeterI suggest using the
·syntax for consistency with our guidelines: https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit#abbreviation-naming-conventions
Yes, that sounds good for me. I'm really looking forward to it in v6. Please let me know when it's released.
Thank you very much for your help.