Skip to content

Commit a0c85c4

Browse files
authored
Add Energy.WattDays (Prefixes) (#758)
1 parent f9d3ff2 commit a0c85c4

File tree

12 files changed

+410
-58
lines changed

12 files changed

+410
-58
lines changed

Common/UnitDefinitions/Energy.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,23 @@
115115
}
116116
]
117117
},
118+
{
119+
"SingularName": "WattDay",
120+
"PluralName": "WattDays",
121+
"FromUnitToBaseFunc": "x*24*3600d",
122+
"FromBaseToUnitFunc": "x/(24*3600d)",
123+
"Prefixes": [ "Kilo", "Mega", "Giga", "Tera" ],
124+
"Localization": [
125+
{
126+
"Culture": "en-US",
127+
"Abbreviations": [ "Wd" ]
128+
},
129+
{
130+
"Culture": "ru-RU",
131+
"Abbreviations": [ "Вт/д" ]
132+
}
133+
]
134+
},
118135
{
119136
"SingularName": "ThermEc",
120137
"PluralName": "ThermsEc",

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

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

UnitsNet.NumberExtensions/GeneratedCode/NumberToEnergyExtensions.g.cs

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

UnitsNet.Tests/CustomCode/EnergyTests.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed under MIT No Attribution, see LICENSE file at the root.
1+
// Licensed under MIT No Attribution, see LICENSE file at the root.
22
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). Maintained at https://github.com/angularsen/UnitsNet.
33

44
using UnitsNet.Units;
@@ -38,6 +38,8 @@ public class EnergyTests : EnergyTestsBase
3838

3939
protected override double TerawattHoursInOneJoule => 2.77777778e-16;
4040

41+
protected override double TerawattDaysInOneJoule => 1.157407407407410E-17;
42+
4143
protected override double ThermsEcInOneJoule => 9.4781712031331720001278504447561e-9;
4244

4345
protected override double FootPoundsInOneJoule => 0.737562149;
@@ -48,16 +50,24 @@ public class EnergyTests : EnergyTestsBase
4850

4951
protected override double GigawattHoursInOneJoule => 2.77777778e-13;
5052

53+
protected override double GigawattDaysInOneJoule => 1.157407407407410E-14;
54+
5155
protected override double KilocaloriesInOneJoule => 0.00023900573614;
5256

5357
protected override double KilowattHoursInOneJoule => 2.77777778e-7;
5458

59+
protected override double KilowattDaysInOneJoule => 1.157407407407410E-08;
60+
5561
protected override double MegawattHoursInOneJoule => 2.77777778e-10;
5662

63+
protected override double MegawattDaysInOneJoule => 1.157407407407410E-11;
64+
5765
protected override double ThermsUsInOneJoule => 9.4804342797334860315281322406817e-9;
5866

5967
protected override double WattHoursInOneJoule => 0.000277777778;
6068

69+
protected override double WattDaysInOneJoule => 1.157407407407410E-05;
70+
6171
protected override double ElectronVoltsInOneJoule => 6.241509343260179e18;
6272

6373
protected override double KiloelectronVoltsInOneJoule => 6.2415093433e+15;

0 commit comments

Comments
 (0)