Skip to content

Commit ee0253d

Browse files
kuhnmMatthias Kuhn
andauthored
Add SpecificEnergy.MegaJoulePerTonne (#1184)
* Add unit definition "MegaJoulePerTonne" to SpecificEnergy * Fix conversion value to/from BaseUnit Co-authored-by: Matthias Kuhn <[email protected]>
1 parent ed0ab59 commit ee0253d

File tree

10 files changed

+135
-40
lines changed

10 files changed

+135
-40
lines changed

Common/UnitDefinitions/SpecificEnergy.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
}
2222
]
2323
},
24+
{
25+
"SingularName": "MegaJoulePerTonne",
26+
"PluralName": "MegaJoulesPerTonne",
27+
"FromUnitToBaseFunc": "{x} * 1e3",
28+
"FromBaseToUnitFunc": "{x} / 1e3",
29+
"Localization": [
30+
{
31+
"Culture": "en-US",
32+
"Abbreviations": [ "MJ/t" ]
33+
}
34+
]
35+
},
2436
{
2537
"SingularName": "CaloriePerGram",
2638
"PluralName": "CaloriesPerGram",

Common/UnitEnumValues.g.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,8 @@
12771277
"WattDayPerShortTon": 26,
12781278
"WattDayPerTonne": 27,
12791279
"WattHourPerKilogram": 28,
1280-
"WattHourPerPound": 29
1280+
"WattHourPerPound": 29,
1281+
"MegaJoulePerTonne": 37
12811282
},
12821283
"SpecificEntropy": {
12831284
"BtuPerPoundFahrenheit": 1,

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

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

UnitsNet.NanoFramework/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.

UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToSpecificEnergyExtensionsTest.g.cs

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

UnitsNet.NumberExtensions/GeneratedCode/NumberToSpecificEnergyExtensions.g.cs

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

UnitsNet.Tests/CustomCode/SpecificEnergyTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class SpecificEnergyTests : SpecificEnergyTestsBase
1111
protected override double JoulesPerKilogramInOneJoulePerKilogram => 1e0;
1212
protected override double KilojoulesPerKilogramInOneJoulePerKilogram => 1e-3;
1313
protected override double MegajoulesPerKilogramInOneJoulePerKilogram => 1e-6;
14+
protected override double MegaJoulesPerTonneInOneJoulePerKilogram => 1e-3;
1415

1516
protected override double BtuPerPoundInOneJoulePerKilogram => 4.299226e-4;
1617

0 commit comments

Comments
 (0)