-
Notifications
You must be signed in to change notification settings - Fork 400
MassConcentration: Add ounce per gallon units #948
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good start!
Just a few more steps are required to complete this:
https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit
Specifically, you need to run generate-code.bat
, implement the generated test case to fix the compile error and push these changes.
"Localization": [ | ||
{ | ||
"Culture": "en-US", | ||
"Abbreviations": [ "opg (U.S)" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with these, but from google it seems this unit abbreviation is more widely used: oz/gal
If so, maybe instead of opg
we could do oz/gal (U.S.)
and oz/gal (imp.)
.
This is also consistent with gal (U.S.)
and fluid ounce oz (U.S.)
in Volume
:
UnitsNet/Common/UnitDefinitions/Volume.json
Line 252 in c168b89
"Abbreviations": [ "gal (U.S.)" ] |
UnitsNet/Common/UnitDefinitions/Volume.json
Line 268 in c168b89
"Abbreviations": [ "oz (U.S.)" ] |
https://www.convert-me.com/en/convert/density/ozpgal.html?u=ozpgal&v=1
https://www.translatorscafe.com/unit-converter/en-US/density/17-33/gram/liter-ounce/gallon%20(US)/
@GianniDPC Great, almost there. What remains is to implement the test case in https://github.com/GianniDPC/UnitsNet/blob/master/UnitsNet.Tests/CustomCode/MassConcentrationTests.cs, which now gives a compile error due to 2 missing properties. Not your fault, but a lot of other files got changed in the PR. I cleaned this up now, so only the relevant files show up. It was due to a recent change in the codegen and your branch was behind on this change. |
Hope everything is OK now @angularsen :) |
@GianniDPC nuget on the way out |
Add Ounce per gallon to Mass Concentration