Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Common/UnitDefinitions/Energy.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@
}
]
},
{
"SingularName": "WattDay",
"PluralName": "WattDays",
"FromUnitToBaseFunc": "x*24*3600d",
"FromBaseToUnitFunc": "x/(24*3600d)",
"Prefixes": [ "Kilo", "Mega", "Giga", "Tera" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "Wd" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "Вт/д" ]
}
]
},
{
"SingularName": "ThermEc",
"PluralName": "ThermsEc",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion UnitsNet.Tests/CustomCode/EnergyTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using UnitsNet.Units;
Expand Down Expand Up @@ -38,6 +38,8 @@ public class EnergyTests : EnergyTestsBase

protected override double TerawattHoursInOneJoule => 2.77777778e-16;

protected override double TerawattDaysInOneJoule => 1.157407407407410E-17;

protected override double ThermsEcInOneJoule => 9.4781712031331720001278504447561e-9;

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

protected override double GigawattHoursInOneJoule => 2.77777778e-13;

protected override double GigawattDaysInOneJoule => 1.157407407407410E-14;

protected override double KilocaloriesInOneJoule => 0.00023900573614;

protected override double KilowattHoursInOneJoule => 2.77777778e-7;

protected override double KilowattDaysInOneJoule => 1.157407407407410E-08;

protected override double MegawattHoursInOneJoule => 2.77777778e-10;

protected override double MegawattDaysInOneJoule => 1.157407407407410E-11;

protected override double ThermsUsInOneJoule => 9.4804342797334860315281322406817e-9;

protected override double WattHoursInOneJoule => 0.000277777778;

protected override double WattDaysInOneJoule => 1.157407407407410E-05;
Copy link
Owner

Choose a reason for hiding this comment

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

I couldn't find a source on this, but WattHours value / 24 give this so looks good to me.


protected override double ElectronVoltsInOneJoule => 6.241509343260179e18;

protected override double KiloelectronVoltsInOneJoule => 6.2415093433e+15;
Expand Down
Loading