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
10 changes: 10 additions & 0 deletions Common/UnitDefinitions/Energy.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,20 @@
"PluralName": "ElectronVolts",
"FromUnitToBaseFunc": "x*1.602176565e-19",
"FromBaseToUnitFunc": "x/1.602176565e-19",
"Prefixes": [
"Kilo",
"Mega",
"Giga",
"Tera"
],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "eV" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "эВ" ]
}
]
},
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.

15 changes: 12 additions & 3 deletions 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 @@ -32,8 +32,6 @@ public class EnergyTests : EnergyTestsBase

protected override double DecathermsUsInOneJoule => 9.480434279733486e-10;

protected override double ElectronVoltsInOneJoule => 6.241509343260179e18;

protected override double ErgsInOneJoule => 10000000;

protected override double MillijoulesInOneJoule => 1000;
Expand All @@ -60,6 +58,17 @@ public class EnergyTests : EnergyTestsBase

protected override double WattHoursInOneJoule => 0.000277777778;

protected override double ElectronVoltsInOneJoule => 6.241509343260179e18;

protected override double KiloelectronVoltsInOneJoule => 6.2415093433e+15;

protected override double MegaelectronVoltsInOneJoule => 6.2415093433e+12;

protected override double GigaelectronVoltsInOneJoule => 6.2415093433e+9;

protected override double TeraelectronVoltsInOneJoule => 6.2415093433e+6;


[Fact]
public void Constructor_UnitSystemSI_AssignsSIUnit()
{
Expand Down
Loading