Skip to content

Commit 5542558

Browse files
mp9007angularsen
authored andcommitted
Add Mass.Grain, SpecificEnergy.BtuPerPound (#582)
1 parent 11f4ebc commit 5542558

File tree

11 files changed

+105
-1
lines changed

11 files changed

+105
-1
lines changed

Common/UnitDefinitions/Mass.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,20 @@
165165
"Abbreviations": [ "cwt" ]
166166
}
167167
]
168+
},
169+
{
170+
"SingularName": "Grain",
171+
"PluralName": "Grains",
172+
"FromUnitToBaseFunc": "x/15432.358352941431",
173+
"FromBaseToUnitFunc": "x*15432.358352941431",
174+
"XmlDocSummary": "A grain is a unit of measurement of mass, and in the troy weight, avoirdupois, and Apothecaries' system, equal to exactly 64.79891 milligrams.",
175+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Grain_(unit)",
176+
"Localization": [
177+
{
178+
"Culture": "en-US",
179+
"Abbreviations": [ "gr" ]
180+
}
181+
]
168182
}
169183
]
170184
}

Common/UnitDefinitions/SpecificEnergy.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@
4646
"Abbreviations": [ "Wh/kg" ]
4747
}
4848
]
49+
},
50+
{
51+
"SingularName": "BtuPerPound",
52+
"PluralName": "BtuPerPound",
53+
"FromUnitToBaseFunc": "x*2326.000075362",
54+
"FromBaseToUnitFunc": "x/2326.000075362",
55+
"Localization": [
56+
{
57+
"Culture": "en-US",
58+
"Abbreviations": [ "btu/lb" ]
59+
}
60+
]
4961
}
5062

5163
]

UnitsNet.Tests/CustomCode/MassTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class MassTests : MassTestsBase
3333

3434
protected override double DecigramsInOneKilogram => 1E4;
3535

36+
protected override double GrainsInOneKilogram => 15432.358352941431d;
37+
3638
protected override double GramsInOneKilogram => 1E3;
3739

3840
protected override double HectogramsInOneKilogram => 10;

UnitsNet.Tests/CustomCode/SpecificEnergyTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class SpecificEnergyTests : SpecificEnergyTestsBase
2828
protected override double JoulesPerKilogramInOneJoulePerKilogram => 1e0;
2929
protected override double KilojoulesPerKilogramInOneJoulePerKilogram => 1e-3;
3030
protected override double MegajoulesPerKilogramInOneJoulePerKilogram => 1e-6;
31+
protected override double BtuPerPoundInOneJoulePerKilogram => 4.299226e-4;
3132
protected override double CaloriesPerGramInOneJoulePerKilogram => 2.3900573613766730401529636711281e-4;
3233
protected override double KilocaloriesPerGramInOneJoulePerKilogram => 2.3900573613766730401529636711281e-7;
3334
protected override double WattHoursPerKilogramInOneJoulePerKilogram => 2.77777778e-4;
@@ -69,4 +70,4 @@ public void SpecificEnergyTimesBrakeSpecificFuelConsumptionEqualsEnergy()
6970
Assert.Equal(200d, value);
7071
}
7172
}
72-
}
73+
}

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/Mass.WindowsRuntimeComponent.g.cs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.WindowsRuntimeComponent/GeneratedCode/Quantities/SpecificEnergy.WindowsRuntimeComponent.g.cs

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/Mass.NetFramework.g.cs

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Quantities/SpecificEnergy.NetFramework.g.cs

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/UnitAbbreviationsCache.g.cs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Units/MassUnit.g.cs

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet/GeneratedCode/Units/SpecificEnergyUnit.g.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)