diff --git a/UnitsNet.Tests/CustomCode/EnergyTests.cs b/UnitsNet.Tests/CustomCode/EnergyTests.cs
index 71351bc8f8..dd8ab24e9b 100644
--- a/UnitsNet.Tests/CustomCode/EnergyTests.cs
+++ b/UnitsNet.Tests/CustomCode/EnergyTests.cs
@@ -30,5 +30,55 @@ public class EnergyTests : EnergyTestsBase
protected override double JoulesInOneJoule { get { return 1; } }
protected override double KilojoulesInOneJoule { get { return 1E-3; } }
protected override double MegajoulesInOneJoule { get { return 1E-6; } }
+
+ protected override double BritishThermalUnitsInOneJoule
+ {
+ get { return 0.00094781712; }
+ }
+
+ protected override double CaloriesInOneJoule
+ {
+ get { return 0.239005736; }
+ }
+
+ protected override double ElectronVoltsInOneJoule
+ {
+ get { return 6.241509343260179e18; }
+ }
+
+ protected override double ErgsInOneJoule
+ {
+ get { return 10000000; }
+ }
+
+ protected override double FootPoundsInOneJoule
+ {
+ get { return 0.737562149; }
+ }
+
+ protected override double GigawattHoursInOneJoule
+ {
+ get { return 2.77777778e-13; }
+ }
+
+ protected override double KilocaloriesInOneJoule
+ {
+ get { return 0.00023900573614; }
+ }
+
+ protected override double KilowattHoursInOneJoule
+ {
+ get { return 2.77777778e-7; }
+ }
+
+ protected override double MegawattHoursInOneJoule
+ {
+ get { return 2.77777778e-10; }
+ }
+
+ protected override double WattHoursInOneJoule
+ {
+ get { return 0.000277777778; }
+ }
}
}
diff --git a/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs
index a592f074bf..5cdb8e4a19 100644
--- a/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/EnergyTestsBase.g.cs
@@ -36,49 +36,109 @@ namespace UnitsNet.Tests
// ReSharper disable once PartialTypeWithSinglePart
public abstract partial class EnergyTestsBase
{
+ protected abstract double BritishThermalUnitsInOneJoule { get; }
+ protected abstract double CaloriesInOneJoule { get; }
+ protected abstract double ElectronVoltsInOneJoule { get; }
+ protected abstract double ErgsInOneJoule { get; }
+ protected abstract double FootPoundsInOneJoule { get; }
+ protected abstract double GigawattHoursInOneJoule { get; }
protected abstract double JoulesInOneJoule { get; }
+ protected abstract double KilocaloriesInOneJoule { get; }
protected abstract double KilojoulesInOneJoule { get; }
+ protected abstract double KilowattHoursInOneJoule { get; }
protected abstract double MegajoulesInOneJoule { get; }
+ protected abstract double MegawattHoursInOneJoule { get; }
+ protected abstract double WattHoursInOneJoule { get; }
// ReSharper disable VirtualMemberNeverOverriden.Global
+ protected virtual double BritishThermalUnitsTolerance { get { return 1e-5; } }
+ protected virtual double CaloriesTolerance { get { return 1e-5; } }
+ protected virtual double ElectronVoltsTolerance { get { return 1e-5; } }
+ protected virtual double ErgsTolerance { get { return 1e-5; } }
+ protected virtual double FootPoundsTolerance { get { return 1e-5; } }
+ protected virtual double GigawattHoursTolerance { get { return 1e-5; } }
protected virtual double JoulesTolerance { get { return 1e-5; } }
+ protected virtual double KilocaloriesTolerance { get { return 1e-5; } }
protected virtual double KilojoulesTolerance { get { return 1e-5; } }
+ protected virtual double KilowattHoursTolerance { get { return 1e-5; } }
protected virtual double MegajoulesTolerance { get { return 1e-5; } }
+ protected virtual double MegawattHoursTolerance { get { return 1e-5; } }
+ protected virtual double WattHoursTolerance { get { return 1e-5; } }
// ReSharper restore VirtualMemberNeverOverriden.Global
[Test]
public void JouleToEnergyUnits()
{
Energy joule = Energy.FromJoules(1);
+ Assert.AreEqual(BritishThermalUnitsInOneJoule, joule.BritishThermalUnits, BritishThermalUnitsTolerance);
+ Assert.AreEqual(CaloriesInOneJoule, joule.Calories, CaloriesTolerance);
+ Assert.AreEqual(ElectronVoltsInOneJoule, joule.ElectronVolts, ElectronVoltsTolerance);
+ Assert.AreEqual(ErgsInOneJoule, joule.Ergs, ErgsTolerance);
+ Assert.AreEqual(FootPoundsInOneJoule, joule.FootPounds, FootPoundsTolerance);
+ Assert.AreEqual(GigawattHoursInOneJoule, joule.GigawattHours, GigawattHoursTolerance);
Assert.AreEqual(JoulesInOneJoule, joule.Joules, JoulesTolerance);
+ Assert.AreEqual(KilocaloriesInOneJoule, joule.Kilocalories, KilocaloriesTolerance);
Assert.AreEqual(KilojoulesInOneJoule, joule.Kilojoules, KilojoulesTolerance);
+ Assert.AreEqual(KilowattHoursInOneJoule, joule.KilowattHours, KilowattHoursTolerance);
Assert.AreEqual(MegajoulesInOneJoule, joule.Megajoules, MegajoulesTolerance);
+ Assert.AreEqual(MegawattHoursInOneJoule, joule.MegawattHours, MegawattHoursTolerance);
+ Assert.AreEqual(WattHoursInOneJoule, joule.WattHours, WattHoursTolerance);
}
[Test]
public void FromValueAndUnit()
{
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.BritishThermalUnit).BritishThermalUnits, BritishThermalUnitsTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.Calorie).Calories, CaloriesTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.ElectronVolt).ElectronVolts, ElectronVoltsTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.Erg).Ergs, ErgsTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.FootPound).FootPounds, FootPoundsTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.GigawattHour).GigawattHours, GigawattHoursTolerance);
Assert.AreEqual(1, Energy.From(1, EnergyUnit.Joule).Joules, JoulesTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.Kilocalorie).Kilocalories, KilocaloriesTolerance);
Assert.AreEqual(1, Energy.From(1, EnergyUnit.Kilojoule).Kilojoules, KilojoulesTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.KilowattHour).KilowattHours, KilowattHoursTolerance);
Assert.AreEqual(1, Energy.From(1, EnergyUnit.Megajoule).Megajoules, MegajoulesTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.MegawattHour).MegawattHours, MegawattHoursTolerance);
+ Assert.AreEqual(1, Energy.From(1, EnergyUnit.WattHour).WattHours, WattHoursTolerance);
}
[Test]
public void As()
{
var joule = Energy.FromJoules(1);
+ Assert.AreEqual(BritishThermalUnitsInOneJoule, joule.As(EnergyUnit.BritishThermalUnit), BritishThermalUnitsTolerance);
+ Assert.AreEqual(CaloriesInOneJoule, joule.As(EnergyUnit.Calorie), CaloriesTolerance);
+ Assert.AreEqual(ElectronVoltsInOneJoule, joule.As(EnergyUnit.ElectronVolt), ElectronVoltsTolerance);
+ Assert.AreEqual(ErgsInOneJoule, joule.As(EnergyUnit.Erg), ErgsTolerance);
+ Assert.AreEqual(FootPoundsInOneJoule, joule.As(EnergyUnit.FootPound), FootPoundsTolerance);
+ Assert.AreEqual(GigawattHoursInOneJoule, joule.As(EnergyUnit.GigawattHour), GigawattHoursTolerance);
Assert.AreEqual(JoulesInOneJoule, joule.As(EnergyUnit.Joule), JoulesTolerance);
+ Assert.AreEqual(KilocaloriesInOneJoule, joule.As(EnergyUnit.Kilocalorie), KilocaloriesTolerance);
Assert.AreEqual(KilojoulesInOneJoule, joule.As(EnergyUnit.Kilojoule), KilojoulesTolerance);
+ Assert.AreEqual(KilowattHoursInOneJoule, joule.As(EnergyUnit.KilowattHour), KilowattHoursTolerance);
Assert.AreEqual(MegajoulesInOneJoule, joule.As(EnergyUnit.Megajoule), MegajoulesTolerance);
+ Assert.AreEqual(MegawattHoursInOneJoule, joule.As(EnergyUnit.MegawattHour), MegawattHoursTolerance);
+ Assert.AreEqual(WattHoursInOneJoule, joule.As(EnergyUnit.WattHour), WattHoursTolerance);
}
[Test]
public void ConversionRoundTrip()
{
Energy joule = Energy.FromJoules(1);
+ Assert.AreEqual(1, Energy.FromBritishThermalUnits(joule.BritishThermalUnits).Joules, BritishThermalUnitsTolerance);
+ Assert.AreEqual(1, Energy.FromCalories(joule.Calories).Joules, CaloriesTolerance);
+ Assert.AreEqual(1, Energy.FromElectronVolts(joule.ElectronVolts).Joules, ElectronVoltsTolerance);
+ Assert.AreEqual(1, Energy.FromErgs(joule.Ergs).Joules, ErgsTolerance);
+ Assert.AreEqual(1, Energy.FromFootPounds(joule.FootPounds).Joules, FootPoundsTolerance);
+ Assert.AreEqual(1, Energy.FromGigawattHours(joule.GigawattHours).Joules, GigawattHoursTolerance);
Assert.AreEqual(1, Energy.FromJoules(joule.Joules).Joules, JoulesTolerance);
+ Assert.AreEqual(1, Energy.FromKilocalories(joule.Kilocalories).Joules, KilocaloriesTolerance);
Assert.AreEqual(1, Energy.FromKilojoules(joule.Kilojoules).Joules, KilojoulesTolerance);
+ Assert.AreEqual(1, Energy.FromKilowattHours(joule.KilowattHours).Joules, KilowattHoursTolerance);
Assert.AreEqual(1, Energy.FromMegajoules(joule.Megajoules).Joules, MegajoulesTolerance);
+ Assert.AreEqual(1, Energy.FromMegawattHours(joule.MegawattHours).Joules, MegawattHoursTolerance);
+ Assert.AreEqual(1, Energy.FromWattHours(joule.WattHours).Joules, WattHoursTolerance);
}
[Test]
diff --git a/UnitsNet.Tests/UnitsNet.Tests.csproj b/UnitsNet.Tests/UnitsNet.Tests.csproj
index 0314f4aa19..545635baf0 100644
--- a/UnitsNet.Tests/UnitsNet.Tests.csproj
+++ b/UnitsNet.Tests/UnitsNet.Tests.csproj
@@ -55,6 +55,7 @@
+
diff --git a/UnitsNet/GeneratedCode/Enums/EnergyUnit.g.cs b/UnitsNet/GeneratedCode/Enums/EnergyUnit.g.cs
index e9f9e84e26..bca5337566 100644
--- a/UnitsNet/GeneratedCode/Enums/EnergyUnit.g.cs
+++ b/UnitsNet/GeneratedCode/Enums/EnergyUnit.g.cs
@@ -25,8 +25,18 @@ namespace UnitsNet.Units
public enum EnergyUnit
{
Undefined = 0,
+ BritishThermalUnit,
+ Calorie,
+ ElectronVolt,
+ Erg,
+ FootPound,
+ GigawattHour,
Joule,
+ Kilocalorie,
Kilojoule,
+ KilowattHour,
Megajoule,
+ MegawattHour,
+ WattHour,
}
}
diff --git a/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs
index 269a18222e..3aa7a8f52c 100644
--- a/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs
+++ b/UnitsNet/GeneratedCode/UnitClasses/Energy.g.cs
@@ -31,7 +31,7 @@
namespace UnitsNet
{
///
- /// The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second
+ /// The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used.
///
// ReSharper disable once PartialTypeWithSinglePart
public partial struct Energy : IComparable, IComparable
@@ -48,6 +48,54 @@ public Energy(double joules) : this()
#region Properties
+ ///
+ /// Get Energy in BritishThermalUnits.
+ ///
+ public double BritishThermalUnits
+ {
+ get { return _joules/1055.05585262; }
+ }
+
+ ///
+ /// Get Energy in Calories.
+ ///
+ public double Calories
+ {
+ get { return _joules/4.184; }
+ }
+
+ ///
+ /// Get Energy in ElectronVolts.
+ ///
+ public double ElectronVolts
+ {
+ get { return _joules/1.602176565e-19; }
+ }
+
+ ///
+ /// Get Energy in Ergs.
+ ///
+ public double Ergs
+ {
+ get { return _joules/1e-7; }
+ }
+
+ ///
+ /// Get Energy in FootPounds.
+ ///
+ public double FootPounds
+ {
+ get { return _joules/1.355817948; }
+ }
+
+ ///
+ /// Get Energy in GigawattHours.
+ ///
+ public double GigawattHours
+ {
+ get { return (_joules/3600d) / 1e9d; }
+ }
+
///
/// Get Energy in Joules.
///
@@ -56,6 +104,14 @@ public double Joules
get { return _joules; }
}
+ ///
+ /// Get Energy in Kilocalories.
+ ///
+ public double Kilocalories
+ {
+ get { return (_joules/4.184) / 1e3d; }
+ }
+
///
/// Get Energy in Kilojoules.
///
@@ -64,6 +120,14 @@ public double Kilojoules
get { return (_joules) / 1e3d; }
}
+ ///
+ /// Get Energy in KilowattHours.
+ ///
+ public double KilowattHours
+ {
+ get { return (_joules/3600d) / 1e3d; }
+ }
+
///
/// Get Energy in Megajoules.
///
@@ -72,6 +136,22 @@ public double Megajoules
get { return (_joules) / 1e6d; }
}
+ ///
+ /// Get Energy in MegawattHours.
+ ///
+ public double MegawattHours
+ {
+ get { return (_joules/3600d) / 1e6d; }
+ }
+
+ ///
+ /// Get Energy in WattHours.
+ ///
+ public double WattHours
+ {
+ get { return _joules/3600d; }
+ }
+
#endregion
#region Static
@@ -81,6 +161,54 @@ public static Energy Zero
get { return new Energy(); }
}
+ ///
+ /// Get Energy from BritishThermalUnits.
+ ///
+ public static Energy FromBritishThermalUnits(double britishthermalunits)
+ {
+ return new Energy(britishthermalunits*1055.05585262);
+ }
+
+ ///
+ /// Get Energy from Calories.
+ ///
+ public static Energy FromCalories(double calories)
+ {
+ return new Energy(calories*4.184);
+ }
+
+ ///
+ /// Get Energy from ElectronVolts.
+ ///
+ public static Energy FromElectronVolts(double electronvolts)
+ {
+ return new Energy(electronvolts*1.602176565e-19);
+ }
+
+ ///
+ /// Get Energy from Ergs.
+ ///
+ public static Energy FromErgs(double ergs)
+ {
+ return new Energy(ergs*1e-7);
+ }
+
+ ///
+ /// Get Energy from FootPounds.
+ ///
+ public static Energy FromFootPounds(double footpounds)
+ {
+ return new Energy(footpounds*1.355817948);
+ }
+
+ ///
+ /// Get Energy from GigawattHours.
+ ///
+ public static Energy FromGigawattHours(double gigawatthours)
+ {
+ return new Energy((gigawatthours*3600d) * 1e9d);
+ }
+
///
/// Get Energy from Joules.
///
@@ -89,6 +217,14 @@ public static Energy FromJoules(double joules)
return new Energy(joules);
}
+ ///
+ /// Get Energy from Kilocalories.
+ ///
+ public static Energy FromKilocalories(double kilocalories)
+ {
+ return new Energy((kilocalories*4.184) * 1e3d);
+ }
+
///
/// Get Energy from Kilojoules.
///
@@ -97,6 +233,14 @@ public static Energy FromKilojoules(double kilojoules)
return new Energy((kilojoules) * 1e3d);
}
+ ///
+ /// Get Energy from KilowattHours.
+ ///
+ public static Energy FromKilowattHours(double kilowatthours)
+ {
+ return new Energy((kilowatthours*3600d) * 1e3d);
+ }
+
///
/// Get Energy from Megajoules.
///
@@ -105,6 +249,22 @@ public static Energy FromMegajoules(double megajoules)
return new Energy((megajoules) * 1e6d);
}
+ ///
+ /// Get Energy from MegawattHours.
+ ///
+ public static Energy FromMegawattHours(double megawatthours)
+ {
+ return new Energy((megawatthours*3600d) * 1e6d);
+ }
+
+ ///
+ /// Get Energy from WattHours.
+ ///
+ public static Energy FromWattHours(double watthours)
+ {
+ return new Energy(watthours*3600d);
+ }
+
///
/// Dynamically convert from value and unit enum to .
@@ -116,12 +276,32 @@ public static Energy From(double value, EnergyUnit fromUnit)
{
switch (fromUnit)
{
+ case EnergyUnit.BritishThermalUnit:
+ return FromBritishThermalUnits(value);
+ case EnergyUnit.Calorie:
+ return FromCalories(value);
+ case EnergyUnit.ElectronVolt:
+ return FromElectronVolts(value);
+ case EnergyUnit.Erg:
+ return FromErgs(value);
+ case EnergyUnit.FootPound:
+ return FromFootPounds(value);
+ case EnergyUnit.GigawattHour:
+ return FromGigawattHours(value);
case EnergyUnit.Joule:
return FromJoules(value);
+ case EnergyUnit.Kilocalorie:
+ return FromKilocalories(value);
case EnergyUnit.Kilojoule:
return FromKilojoules(value);
+ case EnergyUnit.KilowattHour:
+ return FromKilowattHours(value);
case EnergyUnit.Megajoule:
return FromMegajoules(value);
+ case EnergyUnit.MegawattHour:
+ return FromMegawattHours(value);
+ case EnergyUnit.WattHour:
+ return FromWattHours(value);
default:
throw new NotImplementedException("fromUnit: " + fromUnit);
@@ -255,12 +435,32 @@ public double As(EnergyUnit unit)
{
switch (unit)
{
+ case EnergyUnit.BritishThermalUnit:
+ return BritishThermalUnits;
+ case EnergyUnit.Calorie:
+ return Calories;
+ case EnergyUnit.ElectronVolt:
+ return ElectronVolts;
+ case EnergyUnit.Erg:
+ return Ergs;
+ case EnergyUnit.FootPound:
+ return FootPounds;
+ case EnergyUnit.GigawattHour:
+ return GigawattHours;
case EnergyUnit.Joule:
return Joules;
+ case EnergyUnit.Kilocalorie:
+ return Kilocalories;
case EnergyUnit.Kilojoule:
return Kilojoules;
+ case EnergyUnit.KilowattHour:
+ return KilowattHours;
case EnergyUnit.Megajoule:
return Megajoules;
+ case EnergyUnit.MegawattHour:
+ return MegawattHours;
+ case EnergyUnit.WattHour:
+ return WattHours;
default:
throw new NotImplementedException("unit: " + unit);
diff --git a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs
index ab7567c128..4a55f11c47 100644
--- a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs
+++ b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs
@@ -351,21 +351,71 @@ private static readonly ReadOnlyCollection DefaultLocalization
new UnitLocalization(typeof (EnergyUnit),
new[]
{
+ new CulturesForEnumValue((int) EnergyUnit.BritishThermalUnit,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "BTU"),
+ }),
+ new CulturesForEnumValue((int) EnergyUnit.Calorie,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "cal"),
+ }),
+ new CulturesForEnumValue((int) EnergyUnit.ElectronVolt,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "eV"),
+ }),
+ new CulturesForEnumValue((int) EnergyUnit.Erg,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "erg"),
+ }),
+ new CulturesForEnumValue((int) EnergyUnit.FootPound,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "ft·lb"),
+ }),
+ new CulturesForEnumValue((int) EnergyUnit.GigawattHour,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "GWh"),
+ }),
new CulturesForEnumValue((int) EnergyUnit.Joule,
new[]
{
new AbbreviationsForCulture("en-US", "J"),
}),
+ new CulturesForEnumValue((int) EnergyUnit.Kilocalorie,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "kcal"),
+ }),
new CulturesForEnumValue((int) EnergyUnit.Kilojoule,
new[]
{
new AbbreviationsForCulture("en-US", "kJ"),
}),
+ new CulturesForEnumValue((int) EnergyUnit.KilowattHour,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "kWh"),
+ }),
new CulturesForEnumValue((int) EnergyUnit.Megajoule,
new[]
{
new AbbreviationsForCulture("en-US", "MJ"),
}),
+ new CulturesForEnumValue((int) EnergyUnit.MegawattHour,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "MWh"),
+ }),
+ new CulturesForEnumValue((int) EnergyUnit.WattHour,
+ new[]
+ {
+ new AbbreviationsForCulture("en-US", "Wh"),
+ }),
}),
new UnitLocalization(typeof (FlowUnit),
new[]
diff --git a/UnitsNet/Scripts/UnitDefinitions/Energy.json b/UnitsNet/Scripts/UnitDefinitions/Energy.json
index 3eeee2d9f6..098308d342 100644
--- a/UnitsNet/Scripts/UnitDefinitions/Energy.json
+++ b/UnitsNet/Scripts/UnitDefinitions/Energy.json
@@ -1,7 +1,7 @@
{
"Name": "Energy",
"BaseUnit": "Joule",
- "XmlDoc": "The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second",
+ "XmlDoc": "The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used.",
"Units": [
{
"SingularName": "Joule",
@@ -15,6 +15,80 @@
"Abbreviations": ["J"]
}
]
+ },
+ {
+ "SingularName": "Calorie",
+ "PluralName": "Calories",
+ "FromUnitToBaseFunc": "x*4.184",
+ "FromBaseToUnitFunc": "x/4.184",
+ "Prefixes": ["Kilo"],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": ["cal"]
+ }
+ ]
+ },
+ {
+ "SingularName": "BritishThermalUnit",
+ "PluralName": "BritishThermalUnits",
+ "FromUnitToBaseFunc": "x*1055.05585262",
+ "FromBaseToUnitFunc": "x/1055.05585262",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": ["BTU"]
+ }
+ ]
+ },
+ {
+ "SingularName": "ElectronVolt",
+ "PluralName": "ElectronVolts",
+ "FromUnitToBaseFunc": "x*1.602176565e-19",
+ "FromBaseToUnitFunc": "x/1.602176565e-19",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": ["eV"]
+ }
+ ]
+ },
+ {
+ "SingularName": "FootPound",
+ "PluralName": "FootPounds",
+ "FromUnitToBaseFunc": "x*1.355817948",
+ "FromBaseToUnitFunc": "x/1.355817948",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": ["ft·lb"]
+ }
+ ]
+ },
+ {
+ "SingularName": "Erg",
+ "PluralName": "Ergs",
+ "FromUnitToBaseFunc": "x*1e-7",
+ "FromBaseToUnitFunc": "x/1e-7",
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": ["erg"]
+ }
+ ]
+ },
+ {
+ "SingularName": "WattHour",
+ "PluralName": "WattHours",
+ "FromUnitToBaseFunc": "x*3600d",
+ "FromBaseToUnitFunc": "x/3600d",
+ "Prefixes": ["Kilo", "Mega", "Giga"],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": ["Wh"]
+ }
+ ]
}
]
}