Skip to content

Added a few new units and new prefixes for existing units. #291

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

Merged
merged 17 commits into from
Oct 3, 2017

Conversation

DInozemtsev
Copy link
Contributor

  1. BritishThermalUnits: added new prefixes 'Kilo', 'Mega' and 'Giga' to support 'kBTU', 'mBTU', 'mmBTU'
  2. Added a new unit 'CubicFootPerHour'
  3. Pound: added new prefixes 'Kilo' and 'Mega' to support 'KLbs' and 'MLbs'
  4. PoundsPerHour: added new prefixes 'Mega' to support 'Mlb/h'
  5. Added a new unit 'ShortTonPerHour'
  6. Added a new unit 'BritishThermalUnitPerHour'
  7. CubicMeters: added new prefixes 'Hecto' and 'Kilo'
  8. CubicFoot: added new prefixes 'Hecto', 'Kilo' and 'Mega'
  9. ImperialGallons: added new prefixes 'Kilo' and 'Mega'
  10. UsGallons: added new prefixes 'Kilo' and 'Mega'

@angularsen
Copy link
Owner

Awesome stuff, there is just a merge conflict you need to address. Please merge in latest from origin/master or rebase on top of it and fix the conflicts that arise, then push these new changes so the pull request is updated.

I think I saw you were a first-time github contributor, so if you are unsure about these things just ask and I'll help you out.

@DInozemtsev
Copy link
Contributor Author

Hmm... I did merge from your master into mine and there was not any conflicts. However AppVeyor build fails with errors like this:

GeneratedCode\UnitClasses\Energy.g.cs(159,23): error CS0102: The type 'Energy' already contains a definition for 'DecathermsEc' [C:\projects\unitsnet\UnitsNet\UnitsNet.NetStandard10.csproj]

Which is quite odd, because I can not find any duplication of DecathermsEc definition in Energy.g.cs. More than that, it builds perfectly on my local box. Am I missing something here? @angularsen could you please help me on this?

@angularsen
Copy link
Owner

angularsen commented Oct 2, 2017 via email

@DInozemtsev
Copy link
Contributor Author

I've used following command to do merge into my branch:

git pull https://github.com/angularsen/UnitsNet.git master

And I can definitely see your latest commits in my master now.
2017-10-02_1624

@DInozemtsev
Copy link
Contributor Author

Yay! Everything is green now. @angularsen thank you so much for pointing at the problem :)

@angularsen
Copy link
Owner

Awesome, good job :-)

Copy link
Owner

@angularsen angularsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some issues after merging. I will revert the merge and you will have to create a new pull request with the update changes. Sorry for not catching this before merging.

@@ -28,8 +28,12 @@ public class EnergyTests : EnergyTestsBase

protected override double JoulesInOneJoule => 1;

protected override double KilobritishThermalUnitsInOneJoule => 9.4781339449889105832843629746176e-7;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to verify the latest units, I see a difference here with google (BTU, not kBTU): 9.47817...e-7
https://www.google.no/search?q=britishThermalUnitsInOneJoule&oq=britishThermalUnitsInOneJoule&aqs=chrome..69i57.224j0j7&sourceid=chrome&ie=UTF-8


protected override double HectolitersInOneCubicMeter => 1E1;

protected override double ImperialGallonsInOneCubicMeter => 219.96924;

protected override double ImperialOuncesInOneCubicMeter => 35195.07972;

protected override double KilocubicFeetInOneCubicMeter => 3.531472e-2;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, is this really a unit? Kilocubic feet? Sure this is not just 1000 cubicfeet? I can't find kilocubic feet on google.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @angularsen This is a unit of measure, that used in this product https://portfoliomanager.energystar.gov/ and called kcf (thousand cubic feet)
And, yeah, it sounds weird for me too, but guys in the States seems to be absolutely in love with some strange units of measure. Take it or leave it - it's up to you of course.


protected override double HectolitersInOneCubicMeter => 1E1;

protected override double ImperialGallonsInOneCubicMeter => 219.96924;

protected override double ImperialOuncesInOneCubicMeter => 35195.07972;

protected override double KilocubicFeetInOneCubicMeter => 3.531472e-2;
protected override double KilocubicMetersInOneCubicMeter => 0.001;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with kilocubic meters. Doesn't sound right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

protected override double LitersInOneCubicMeter => 1E3;
protected override double MegacubicFeetInOneCubicMeter => 3.531472e-5;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the megacubic ones too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same here, they called it Kcm (Thousand Cubic meters)

protected override double LitersInOneCubicMeter => 1E3;
protected override double MegacubicFeetInOneCubicMeter => 3.531472e-5;
protected override double MegaimperialGallonsInOneCubicMeter => 2.1996924e-4;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do find megaimperial gallons though so this one should be OK, still sounds funny to me :-)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And that means mega US gallons probably also is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like in U.S. they call them KGal (thousand gallons) (US) and KGal (thousand gallons) (UK)

angularsen pushed a commit that referenced this pull request Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants