Skip to content

Commit

Permalink
Merge pull request #173 from massonib/fix/density
Browse files Browse the repository at this point in the history
* Fix to the density conversions in the .json file
* Updated conversions to be the same style. NEED TO RUN GenerateUnits.Bat
  • Loading branch information
angularsen authored Jul 8, 2016
2 parents 8c7c9e5 + fc83586 commit d1b3ba4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions UnitsNet/GeneratedCode/UnitClasses/Density.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static DensityUnit BaseUnit
/// </summary>
public double KilogramsPerCubicCentimeter
{
get { return _kilogramsPerCubicMeter*0.00000001; }
get { return _kilogramsPerCubicMeter*1e-6; }
}

/// <summary>
Expand All @@ -114,7 +114,7 @@ public double KilogramsPerCubicMeter
/// </summary>
public double KilogramsPerCubicMillimeter
{
get { return _kilogramsPerCubicMeter*0.000000000001; }
get { return _kilogramsPerCubicMeter*1e-9; }
}

/// <summary>
Expand Down Expand Up @@ -154,7 +154,7 @@ public double PoundsPerCubicInch
/// </summary>
public double TonnesPerCubicCentimeter
{
get { return _kilogramsPerCubicMeter*0.00000000001; }
get { return _kilogramsPerCubicMeter*1e-9; }
}

/// <summary>
Expand All @@ -170,7 +170,7 @@ public double TonnesPerCubicMeter
/// </summary>
public double TonnesPerCubicMillimeter
{
get { return _kilogramsPerCubicMeter*0.000000000000001; }
get { return _kilogramsPerCubicMeter*1e-12; }
}

#endregion
Expand All @@ -187,7 +187,7 @@ public static Density Zero
/// </summary>
public static Density FromKilogramsPerCubicCentimeter(double kilogramspercubiccentimeter)
{
return new Density(kilogramspercubiccentimeter*100000000);
return new Density(kilogramspercubiccentimeter*1e+6);
}

/// <summary>
Expand All @@ -203,7 +203,7 @@ public static Density FromKilogramsPerCubicMeter(double kilogramspercubicmeter)
/// </summary>
public static Density FromKilogramsPerCubicMillimeter(double kilogramspercubicmillimeter)
{
return new Density(kilogramspercubicmillimeter*1000000000000);
return new Density(kilogramspercubicmillimeter*1e+9);
}

/// <summary>
Expand Down Expand Up @@ -243,7 +243,7 @@ public static Density FromPoundsPerCubicInch(double poundspercubicinch)
/// </summary>
public static Density FromTonnesPerCubicCentimeter(double tonnespercubiccentimeter)
{
return new Density(tonnespercubiccentimeter*100000000000);
return new Density(tonnespercubiccentimeter*1e+9);
}

/// <summary>
Expand All @@ -259,7 +259,7 @@ public static Density FromTonnesPerCubicMeter(double tonnespercubicmeter)
/// </summary>
public static Density FromTonnesPerCubicMillimeter(double tonnespercubicmillimeter)
{
return new Density(tonnespercubicmillimeter*1000000000000000);
return new Density(tonnespercubicmillimeter*1e+12);
}

#if !WINDOWS_UWP
Expand Down
22 changes: 11 additions & 11 deletions UnitsNet/Scripts/UnitDefinitions/Density.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"SingularName": "KilogramPerCubicMillimeter",
"PluralName": "KilogramsPerCubicMillimeter",
"FromUnitToBaseFunc": "x*1000000000000",
"FromBaseToUnitFunc": "x*0.000000000001",
"FromUnitToBaseFunc": "x/1e-9",
"FromBaseToUnitFunc": "x*1e-9",
"Localization": [
{
"Culture": "en-US",
Expand All @@ -19,8 +19,8 @@
{
"SingularName": "KilogramPerCubicCentimeter",
"PluralName": "KilogramsPerCubicCentimeter",
"FromUnitToBaseFunc": "x*100000000",
"FromBaseToUnitFunc": "x*0.00000001",
"FromUnitToBaseFunc": "x/1e-6",
"FromBaseToUnitFunc": "x*1e-6",
"Localization": [
{
"Culture": "en-US",
Expand All @@ -47,8 +47,8 @@
{
"SingularName": "PoundPerCubicInch",
"PluralName": "PoundsPerCubicInch",
"FromUnitToBaseFunc": "x*27679.904710191",
"FromBaseToUnitFunc": "x/27679.904710191",
"FromUnitToBaseFunc": "x/3.6127298147753e-5",
"FromBaseToUnitFunc": "x*3.6127298147753e-5",
"Prefixes": [ "Kilo" ],
"Localization": [
{
Expand All @@ -75,8 +75,8 @@
{
"SingularName": "TonnePerCubicMillimeter",
"PluralName": "TonnesPerCubicMillimeter",
"FromUnitToBaseFunc": "x*1000000000000000",
"FromBaseToUnitFunc": "x*0.000000000000001",
"FromUnitToBaseFunc": "x/1e-9",
"FromBaseToUnitFunc": "x*1e-12",
"Localization": [
{
"Culture": "en-US",
Expand All @@ -87,8 +87,8 @@
{
"SingularName": "TonnePerCubicCentimeter",
"PluralName": "TonnesPerCubicCentimeter",
"FromUnitToBaseFunc": "x*100000000000",
"FromBaseToUnitFunc": "x*0.00000000001",
"FromUnitToBaseFunc": "x/1e-9",
"FromBaseToUnitFunc": "x*1e-9",
"Localization": [
{
"Culture": "en-US",
Expand All @@ -99,7 +99,7 @@
{
"SingularName": "TonnePerCubicMeter",
"PluralName": "TonnesPerCubicMeter",
"FromUnitToBaseFunc": "x*1000",
"FromUnitToBaseFunc": "x/0.001",
"FromBaseToUnitFunc": "x*0.001",
"Localization": [
{
Expand Down

2 comments on commit d1b3ba4

@angularsen
Copy link
Owner Author

Choose a reason for hiding this comment

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

TeamCity Units.NET :: Master Build 51 is now running

@angularsen
Copy link
Owner Author

Choose a reason for hiding this comment

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

TeamCity Units.NET :: Master Build 51 outcome was FAILURE
Summary: Tests failed: 2 (2 new), passed: 729; artifacts size (bytes) is too small: 10953454 (new) Build time: 0:0:24

Failed tests

UnitsNet.Tests.dll: UnitsNet.Tests.CustomCode.DensityTests.DensityTestsBase.ConversionRoundTrip: <no details avaliable>

UnitsNet.Tests.dll: UnitsNet.Tests.CustomCode.DensityTests.DensityTestsBase.FromValueAndUnit: <no details avaliable>

Please sign in to comment.