-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Support] Parsing PJ #1142
Comments
Hi. As far as I can see, Petajoule is currently not available as EnergyUnit, right? https://github.com/angularsen/UnitsNet/blob/master/UnitsNet/GeneratedCode/Units/EnergyUnit.g.cs So I guess we would need to create a PR to add PJ. Of course, the question is then about TeraJoule, ExaJoule etc. https://en.wikipedia.org/wiki/Orders_of_magnitude_(energy) |
@Brunni I think I have a PR ready (#1143). However, I could not run the test because the project cannot build despite having installed .NET 5.0. (VS Studio is asking me to install many other framework like 4.0, 4.7.2, to build the project) I am using visual studio 2022 preview are you aware of any issue regarding using the outdated framework with the latest VS studio? |
@akasolace Try removing
In v5 #982 , we drop support for the older .NET frameworks.
|
@angularsen indeed removing net4.0 allowed me to build and run the test that were all successful. |
I'm not sure what wrong exactly, but master branch built just fine now and also we have recently switched to Azure DevOps: https://dev.azure.com/unitsnet/Units.NET |
v5 was merged into master, so net40 and net47 targets are no longer present. |
First of all, thank you for making this library open-source.
In my energy conversion app, I am using the function
Energy.TryParseUnit()
.I had already encountered not recognized abbreviations that I could fix using
MapUnitToDefaultAbbreviation
, for example:UnitAbbreviationsCache.Default.MapUnitToDefaultAbbreviation(VolumeUnit.CubicKilometer, "bcm");
But now I have encountered unit PetaJoule "PJ" and the parsing is throwing an error. I have tried something like the following but it does not work
UnitAbbreviationsCache.Default.MapUnitToDefaultAbbreviation(new Energy(1000, EnergyUnit.Gigajoule), "joule");
Any help would be welcome.
Thank you
The text was updated successfully, but these errors were encountered: