diff --git a/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs b/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs
index 04d8acad5f..f4fc931745 100644
--- a/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs
+++ b/CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs
@@ -167,67 +167,67 @@ private void GenerateStaticFactoryMethods()
private void GenerateConversionMethods()
{
Writer.WL($@"
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As({_unitEnumName} unit) => GetValueAs(unit);
-
- ///
- /// Converts this {_quantity.Name} to another {_quantity.Name} with the unit representation .
- ///
- /// A {_quantity.Name} with the specified unit.
- public {_quantity.Name} ToUnit({_unitEnumName} unit)
- {{
- var convertedValue = GetValueAs(unit);
- return new {_quantity.Name}(convertedValue, unit);
- }}
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {{
- return Unit switch
- {{");
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As({_unitEnumName} unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this {_quantity.Name} to another {_quantity.Name} with the unit representation .
+ ///
+ /// A {_quantity.Name} with the specified unit.
+ public {_quantity.Name} ToUnit({_unitEnumName} unit)
+ {{
+ var convertedValue = GetValueAs(unit);
+ return new {_quantity.Name}(convertedValue, unit);
+ }}
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {{
+ return Unit switch
+ {{");
foreach (Unit unit in _quantity.Units)
{
var func = unit.FromUnitToBaseFunc.Replace("{x}", "_value");
Writer.WL($@"
- {_unitEnumName}.{unit.SingularName} => {func},");
+ {_unitEnumName}.{unit.SingularName} => {func},");
}
Writer.WL($@"
- _ => throw new NotImplementedException($""Can't convert {{Unit}} to base units."")
- }};
- }}
+ _ => throw new NotImplementedException($""Can't convert {{Unit}} to base units."")
+ }};
+ }}
- private double GetValueAs({_unitEnumName} unit)
- {{
- if (Unit == unit)
- return _value;
+ private double GetValueAs({_unitEnumName} unit)
+ {{
+ if (Unit == unit)
+ return _value;
- var baseUnitValue = GetValueInBaseUnit();
+ var baseUnitValue = GetValueInBaseUnit();
- return unit switch
- {{");
+ return unit switch
+ {{");
foreach (Unit unit in _quantity.Units)
{
var func = unit.FromBaseToUnitFunc.Replace("{x}", "baseUnitValue");
Writer.WL($@"
- {_unitEnumName}.{unit.SingularName} => {func},");
+ {_unitEnumName}.{unit.SingularName} => {func},");
}
Writer.WL(@"
- _ => throw new NotImplementedException($""Can't convert {Unit} to {unit}."")
- };
- }
+ _ => throw new NotImplementedException($""Can't convert {Unit} to {unit}."")
+ };
+ }
- #endregion");
+ #endregion");
}
///
diff --git a/Common/UnitDefinitions/NominalPower.json b/Common/UnitDefinitions/NominalPower.json
new file mode 100644
index 0000000000..28e6ae2b41
--- /dev/null
+++ b/Common/UnitDefinitions/NominalPower.json
@@ -0,0 +1,25 @@
+{
+ "Name": "NominalPower",
+ "BaseUnit": "WattPeak",
+ "XmlDocSummary": "The nominal power is the nameplate capacity of photovoltaic (PV) devices, such as solar cells, panels and systems, and is determined by measuring the electric current and voltage in a circuit, while varying the resistance under precisely defined conditions.",
+ "XmlDocRemarks": "https://en.wikipedia.org/wiki/Nominal_power_(photovoltaic)",
+ "Units": [
+ {
+ "SingularName": "WattPeak",
+ "PluralName": "WattsPeak",
+ "FromUnitToBaseFunc": "{x}",
+ "FromBaseToUnitFunc": "{x}",
+ "Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ],
+ "Localization": [
+ {
+ "Culture": "en-US",
+ "Abbreviations": [ "Wp" ]
+ },
+ {
+ "Culture": "fr-FR",
+ "Abbreviations": [ "Wc" ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/Common/UnitEnumValues.g.json b/Common/UnitEnumValues.g.json
index 3ebdc3d87d..6f7fab62b2 100644
--- a/Common/UnitEnumValues.g.json
+++ b/Common/UnitEnumValues.g.json
@@ -2018,5 +2018,20 @@
"SquareMeterKelvinPerKilowatt": 5,
"SquareMeterKelvinPerWatt": 4,
"SquareMillimeterKelvinPerWatt": 13
+ },
+ "NominalPower": {
+ "DecawattPeak": 1,
+ "DeciwattPeak": 2,
+ "FemtowattPeak": 3,
+ "GigawattPeak": 4,
+ "KilowattPeak": 5,
+ "MegawattPeak": 6,
+ "MicrowattPeak": 7,
+ "MilliwattPeak": 8,
+ "NanowattPeak": 9,
+ "PetawattPeak": 10,
+ "PicowattPeak": 11,
+ "TerawattPeak": 12,
+ "WattPeak": 13
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/NominalPower/NominalPower.nfproj b/UnitsNet.NanoFramework/GeneratedCode/NominalPower/NominalPower.nfproj
new file mode 100644
index 0000000000..b5146de3aa
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/NominalPower/NominalPower.nfproj
@@ -0,0 +1,42 @@
+
+
+
+ $(MSBuildExtensionsPath)\nanoFramework\v1.0\
+
+
+
+ Debug
+ AnyCPU
+ {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ {6f14ad52-dce6-4e54-fd46-6ebbe10ac874}
+ Library
+ Properties
+ 512
+ UnitsNet
+ UnitsNet.NominalPower
+ v1.0
+ bin\$(Configuration)\$(AssemblyName).xml
+
+
+
+
+
+
+
+
+
+ ..\packages\nanoFramework.CoreLibrary.1.15.5\lib\mscorlib.dll
+ True
+ True
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/NominalPower/UnitsNet.NanoFramework.NominalPower.nuspec b/UnitsNet.NanoFramework/GeneratedCode/NominalPower/UnitsNet.NanoFramework.NominalPower.nuspec
new file mode 100644
index 0000000000..121866824c
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/NominalPower/UnitsNet.NanoFramework.NominalPower.nuspec
@@ -0,0 +1,26 @@
+
+
+
+ UnitsNet.nanoFramework.NominalPower
+ 6.0.0-pre019
+ Units.NET NominalPower - nanoFramework
+ Andreas Gullberg Larsen,nanoframework
+ UnitsNet
+ MIT-0
+ https://github.com/angularsen/UnitsNet
+ false
+ Adds NominalPower units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.
+ https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png
+
+
+ Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com).
+ en-US
+ nanoframework nominalpower unit units quantity quantities measurement si metric imperial abbreviation abbreviations convert conversion parse immutable
+
+
+
+
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/NominalPower/packages.config b/UnitsNet.NanoFramework/GeneratedCode/NominalPower/packages.config
new file mode 100644
index 0000000000..313a8dccdf
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/NominalPower/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs
index a4d71717ff..8ae89a7ae3 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs
@@ -268,85 +268,85 @@ public static AbsorbedDoseOfIonizingRadiation From(double value, AbsorbedDoseOfI
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AbsorbedDoseOfIonizingRadiationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this AbsorbedDoseOfIonizingRadiation to another AbsorbedDoseOfIonizingRadiation with the unit representation .
- ///
- /// A AbsorbedDoseOfIonizingRadiation with the specified unit.
- public AbsorbedDoseOfIonizingRadiation ToUnit(AbsorbedDoseOfIonizingRadiationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new AbsorbedDoseOfIonizingRadiation(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AbsorbedDoseOfIonizingRadiationUnit.Centigray => (_value) * 1e-2d,
- AbsorbedDoseOfIonizingRadiationUnit.Decigray => (_value) * 1e-1d,
- AbsorbedDoseOfIonizingRadiationUnit.Femtogray => (_value) * 1e-15d,
- AbsorbedDoseOfIonizingRadiationUnit.Gigagray => (_value) * 1e9d,
- AbsorbedDoseOfIonizingRadiationUnit.Gray => _value,
- AbsorbedDoseOfIonizingRadiationUnit.Kilogray => (_value) * 1e3d,
- AbsorbedDoseOfIonizingRadiationUnit.Kilorad => (_value / 100) * 1e3d,
- AbsorbedDoseOfIonizingRadiationUnit.Megagray => (_value) * 1e6d,
- AbsorbedDoseOfIonizingRadiationUnit.Megarad => (_value / 100) * 1e6d,
- AbsorbedDoseOfIonizingRadiationUnit.Microgray => (_value) * 1e-6d,
- AbsorbedDoseOfIonizingRadiationUnit.Milligray => (_value) * 1e-3d,
- AbsorbedDoseOfIonizingRadiationUnit.Millirad => (_value / 100) * 1e-3d,
- AbsorbedDoseOfIonizingRadiationUnit.Nanogray => (_value) * 1e-9d,
- AbsorbedDoseOfIonizingRadiationUnit.Petagray => (_value) * 1e15d,
- AbsorbedDoseOfIonizingRadiationUnit.Picogray => (_value) * 1e-12d,
- AbsorbedDoseOfIonizingRadiationUnit.Rad => _value / 100,
- AbsorbedDoseOfIonizingRadiationUnit.Teragray => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AbsorbedDoseOfIonizingRadiationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AbsorbedDoseOfIonizingRadiationUnit.Centigray => (baseUnitValue) / 1e-2d,
- AbsorbedDoseOfIonizingRadiationUnit.Decigray => (baseUnitValue) / 1e-1d,
- AbsorbedDoseOfIonizingRadiationUnit.Femtogray => (baseUnitValue) / 1e-15d,
- AbsorbedDoseOfIonizingRadiationUnit.Gigagray => (baseUnitValue) / 1e9d,
- AbsorbedDoseOfIonizingRadiationUnit.Gray => baseUnitValue,
- AbsorbedDoseOfIonizingRadiationUnit.Kilogray => (baseUnitValue) / 1e3d,
- AbsorbedDoseOfIonizingRadiationUnit.Kilorad => (baseUnitValue * 100) / 1e3d,
- AbsorbedDoseOfIonizingRadiationUnit.Megagray => (baseUnitValue) / 1e6d,
- AbsorbedDoseOfIonizingRadiationUnit.Megarad => (baseUnitValue * 100) / 1e6d,
- AbsorbedDoseOfIonizingRadiationUnit.Microgray => (baseUnitValue) / 1e-6d,
- AbsorbedDoseOfIonizingRadiationUnit.Milligray => (baseUnitValue) / 1e-3d,
- AbsorbedDoseOfIonizingRadiationUnit.Millirad => (baseUnitValue * 100) / 1e-3d,
- AbsorbedDoseOfIonizingRadiationUnit.Nanogray => (baseUnitValue) / 1e-9d,
- AbsorbedDoseOfIonizingRadiationUnit.Petagray => (baseUnitValue) / 1e15d,
- AbsorbedDoseOfIonizingRadiationUnit.Picogray => (baseUnitValue) / 1e-12d,
- AbsorbedDoseOfIonizingRadiationUnit.Rad => baseUnitValue * 100,
- AbsorbedDoseOfIonizingRadiationUnit.Teragray => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AbsorbedDoseOfIonizingRadiationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this AbsorbedDoseOfIonizingRadiation to another AbsorbedDoseOfIonizingRadiation with the unit representation .
+ ///
+ /// A AbsorbedDoseOfIonizingRadiation with the specified unit.
+ public AbsorbedDoseOfIonizingRadiation ToUnit(AbsorbedDoseOfIonizingRadiationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new AbsorbedDoseOfIonizingRadiation(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AbsorbedDoseOfIonizingRadiationUnit.Centigray => (_value) * 1e-2d,
+ AbsorbedDoseOfIonizingRadiationUnit.Decigray => (_value) * 1e-1d,
+ AbsorbedDoseOfIonizingRadiationUnit.Femtogray => (_value) * 1e-15d,
+ AbsorbedDoseOfIonizingRadiationUnit.Gigagray => (_value) * 1e9d,
+ AbsorbedDoseOfIonizingRadiationUnit.Gray => _value,
+ AbsorbedDoseOfIonizingRadiationUnit.Kilogray => (_value) * 1e3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Kilorad => (_value / 100) * 1e3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Megagray => (_value) * 1e6d,
+ AbsorbedDoseOfIonizingRadiationUnit.Megarad => (_value / 100) * 1e6d,
+ AbsorbedDoseOfIonizingRadiationUnit.Microgray => (_value) * 1e-6d,
+ AbsorbedDoseOfIonizingRadiationUnit.Milligray => (_value) * 1e-3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Millirad => (_value / 100) * 1e-3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Nanogray => (_value) * 1e-9d,
+ AbsorbedDoseOfIonizingRadiationUnit.Petagray => (_value) * 1e15d,
+ AbsorbedDoseOfIonizingRadiationUnit.Picogray => (_value) * 1e-12d,
+ AbsorbedDoseOfIonizingRadiationUnit.Rad => _value / 100,
+ AbsorbedDoseOfIonizingRadiationUnit.Teragray => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AbsorbedDoseOfIonizingRadiationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AbsorbedDoseOfIonizingRadiationUnit.Centigray => (baseUnitValue) / 1e-2d,
+ AbsorbedDoseOfIonizingRadiationUnit.Decigray => (baseUnitValue) / 1e-1d,
+ AbsorbedDoseOfIonizingRadiationUnit.Femtogray => (baseUnitValue) / 1e-15d,
+ AbsorbedDoseOfIonizingRadiationUnit.Gigagray => (baseUnitValue) / 1e9d,
+ AbsorbedDoseOfIonizingRadiationUnit.Gray => baseUnitValue,
+ AbsorbedDoseOfIonizingRadiationUnit.Kilogray => (baseUnitValue) / 1e3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Kilorad => (baseUnitValue * 100) / 1e3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Megagray => (baseUnitValue) / 1e6d,
+ AbsorbedDoseOfIonizingRadiationUnit.Megarad => (baseUnitValue * 100) / 1e6d,
+ AbsorbedDoseOfIonizingRadiationUnit.Microgray => (baseUnitValue) / 1e-6d,
+ AbsorbedDoseOfIonizingRadiationUnit.Milligray => (baseUnitValue) / 1e-3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Millirad => (baseUnitValue * 100) / 1e-3d,
+ AbsorbedDoseOfIonizingRadiationUnit.Nanogray => (baseUnitValue) / 1e-9d,
+ AbsorbedDoseOfIonizingRadiationUnit.Petagray => (baseUnitValue) / 1e15d,
+ AbsorbedDoseOfIonizingRadiationUnit.Picogray => (baseUnitValue) / 1e-12d,
+ AbsorbedDoseOfIonizingRadiationUnit.Rad => baseUnitValue * 100,
+ AbsorbedDoseOfIonizingRadiationUnit.Teragray => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Acceleration.g.cs
index 6554701aea..c1fd1e2a40 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Acceleration.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Acceleration.g.cs
@@ -235,79 +235,79 @@ public static Acceleration From(double value, AccelerationUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AccelerationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Acceleration to another Acceleration with the unit representation .
- ///
- /// A Acceleration with the specified unit.
- public Acceleration ToUnit(AccelerationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Acceleration(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AccelerationUnit.CentimeterPerSecondSquared => (_value) * 1e-2d,
- AccelerationUnit.DecimeterPerSecondSquared => (_value) * 1e-1d,
- AccelerationUnit.FootPerSecondSquared => _value * 0.304800,
- AccelerationUnit.InchPerSecondSquared => _value * 0.0254,
- AccelerationUnit.KilometerPerSecondSquared => (_value) * 1e3d,
- AccelerationUnit.KnotPerHour => _value * (1852.0 / 3600.0) / 3600,
- AccelerationUnit.KnotPerMinute => _value * (1852.0 / 3600.0) / 60,
- AccelerationUnit.KnotPerSecond => _value * (1852.0 / 3600.0),
- AccelerationUnit.MeterPerSecondSquared => _value,
- AccelerationUnit.MicrometerPerSecondSquared => (_value) * 1e-6d,
- AccelerationUnit.MillimeterPerSecondSquared => (_value) * 1e-3d,
- AccelerationUnit.MillistandardGravity => (_value * 9.80665) * 1e-3d,
- AccelerationUnit.NanometerPerSecondSquared => (_value) * 1e-9d,
- AccelerationUnit.StandardGravity => _value * 9.80665,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AccelerationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AccelerationUnit.CentimeterPerSecondSquared => (baseUnitValue) / 1e-2d,
- AccelerationUnit.DecimeterPerSecondSquared => (baseUnitValue) / 1e-1d,
- AccelerationUnit.FootPerSecondSquared => baseUnitValue / 0.304800,
- AccelerationUnit.InchPerSecondSquared => baseUnitValue / 0.0254,
- AccelerationUnit.KilometerPerSecondSquared => (baseUnitValue) / 1e3d,
- AccelerationUnit.KnotPerHour => baseUnitValue * 3600 / (1852.0 / 3600.0),
- AccelerationUnit.KnotPerMinute => baseUnitValue * 60 / (1852.0 / 3600.0),
- AccelerationUnit.KnotPerSecond => baseUnitValue / (1852.0 / 3600.0),
- AccelerationUnit.MeterPerSecondSquared => baseUnitValue,
- AccelerationUnit.MicrometerPerSecondSquared => (baseUnitValue) / 1e-6d,
- AccelerationUnit.MillimeterPerSecondSquared => (baseUnitValue) / 1e-3d,
- AccelerationUnit.MillistandardGravity => (baseUnitValue / 9.80665) / 1e-3d,
- AccelerationUnit.NanometerPerSecondSquared => (baseUnitValue) / 1e-9d,
- AccelerationUnit.StandardGravity => baseUnitValue / 9.80665,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AccelerationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Acceleration to another Acceleration with the unit representation .
+ ///
+ /// A Acceleration with the specified unit.
+ public Acceleration ToUnit(AccelerationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Acceleration(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AccelerationUnit.CentimeterPerSecondSquared => (_value) * 1e-2d,
+ AccelerationUnit.DecimeterPerSecondSquared => (_value) * 1e-1d,
+ AccelerationUnit.FootPerSecondSquared => _value * 0.304800,
+ AccelerationUnit.InchPerSecondSquared => _value * 0.0254,
+ AccelerationUnit.KilometerPerSecondSquared => (_value) * 1e3d,
+ AccelerationUnit.KnotPerHour => _value * (1852.0 / 3600.0) / 3600,
+ AccelerationUnit.KnotPerMinute => _value * (1852.0 / 3600.0) / 60,
+ AccelerationUnit.KnotPerSecond => _value * (1852.0 / 3600.0),
+ AccelerationUnit.MeterPerSecondSquared => _value,
+ AccelerationUnit.MicrometerPerSecondSquared => (_value) * 1e-6d,
+ AccelerationUnit.MillimeterPerSecondSquared => (_value) * 1e-3d,
+ AccelerationUnit.MillistandardGravity => (_value * 9.80665) * 1e-3d,
+ AccelerationUnit.NanometerPerSecondSquared => (_value) * 1e-9d,
+ AccelerationUnit.StandardGravity => _value * 9.80665,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AccelerationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AccelerationUnit.CentimeterPerSecondSquared => (baseUnitValue) / 1e-2d,
+ AccelerationUnit.DecimeterPerSecondSquared => (baseUnitValue) / 1e-1d,
+ AccelerationUnit.FootPerSecondSquared => baseUnitValue / 0.304800,
+ AccelerationUnit.InchPerSecondSquared => baseUnitValue / 0.0254,
+ AccelerationUnit.KilometerPerSecondSquared => (baseUnitValue) / 1e3d,
+ AccelerationUnit.KnotPerHour => baseUnitValue * 3600 / (1852.0 / 3600.0),
+ AccelerationUnit.KnotPerMinute => baseUnitValue * 60 / (1852.0 / 3600.0),
+ AccelerationUnit.KnotPerSecond => baseUnitValue / (1852.0 / 3600.0),
+ AccelerationUnit.MeterPerSecondSquared => baseUnitValue,
+ AccelerationUnit.MicrometerPerSecondSquared => (baseUnitValue) / 1e-6d,
+ AccelerationUnit.MillimeterPerSecondSquared => (baseUnitValue) / 1e-3d,
+ AccelerationUnit.MillistandardGravity => (baseUnitValue / 9.80665) / 1e-3d,
+ AccelerationUnit.NanometerPerSecondSquared => (baseUnitValue) / 1e-9d,
+ AccelerationUnit.StandardGravity => baseUnitValue / 9.80665,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmountOfSubstance.g.cs
index 938727458b..06bd1a6ad5 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmountOfSubstance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmountOfSubstance.g.cs
@@ -265,85 +265,85 @@ public static AmountOfSubstance From(double value, AmountOfSubstanceUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AmountOfSubstanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this AmountOfSubstance to another AmountOfSubstance with the unit representation .
- ///
- /// A AmountOfSubstance with the specified unit.
- public AmountOfSubstance ToUnit(AmountOfSubstanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new AmountOfSubstance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AmountOfSubstanceUnit.Centimole => (_value) * 1e-2d,
- AmountOfSubstanceUnit.CentipoundMole => (_value * 453.59237) * 1e-2d,
- AmountOfSubstanceUnit.Decimole => (_value) * 1e-1d,
- AmountOfSubstanceUnit.DecipoundMole => (_value * 453.59237) * 1e-1d,
- AmountOfSubstanceUnit.Femtomole => (_value) * 1e-15d,
- AmountOfSubstanceUnit.Kilomole => (_value) * 1e3d,
- AmountOfSubstanceUnit.KilopoundMole => (_value * 453.59237) * 1e3d,
- AmountOfSubstanceUnit.Megamole => (_value) * 1e6d,
- AmountOfSubstanceUnit.Micromole => (_value) * 1e-6d,
- AmountOfSubstanceUnit.MicropoundMole => (_value * 453.59237) * 1e-6d,
- AmountOfSubstanceUnit.Millimole => (_value) * 1e-3d,
- AmountOfSubstanceUnit.MillipoundMole => (_value * 453.59237) * 1e-3d,
- AmountOfSubstanceUnit.Mole => _value,
- AmountOfSubstanceUnit.Nanomole => (_value) * 1e-9d,
- AmountOfSubstanceUnit.NanopoundMole => (_value * 453.59237) * 1e-9d,
- AmountOfSubstanceUnit.Picomole => (_value) * 1e-12d,
- AmountOfSubstanceUnit.PoundMole => _value * 453.59237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AmountOfSubstanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AmountOfSubstanceUnit.Centimole => (baseUnitValue) / 1e-2d,
- AmountOfSubstanceUnit.CentipoundMole => (baseUnitValue / 453.59237) / 1e-2d,
- AmountOfSubstanceUnit.Decimole => (baseUnitValue) / 1e-1d,
- AmountOfSubstanceUnit.DecipoundMole => (baseUnitValue / 453.59237) / 1e-1d,
- AmountOfSubstanceUnit.Femtomole => (baseUnitValue) / 1e-15d,
- AmountOfSubstanceUnit.Kilomole => (baseUnitValue) / 1e3d,
- AmountOfSubstanceUnit.KilopoundMole => (baseUnitValue / 453.59237) / 1e3d,
- AmountOfSubstanceUnit.Megamole => (baseUnitValue) / 1e6d,
- AmountOfSubstanceUnit.Micromole => (baseUnitValue) / 1e-6d,
- AmountOfSubstanceUnit.MicropoundMole => (baseUnitValue / 453.59237) / 1e-6d,
- AmountOfSubstanceUnit.Millimole => (baseUnitValue) / 1e-3d,
- AmountOfSubstanceUnit.MillipoundMole => (baseUnitValue / 453.59237) / 1e-3d,
- AmountOfSubstanceUnit.Mole => baseUnitValue,
- AmountOfSubstanceUnit.Nanomole => (baseUnitValue) / 1e-9d,
- AmountOfSubstanceUnit.NanopoundMole => (baseUnitValue / 453.59237) / 1e-9d,
- AmountOfSubstanceUnit.Picomole => (baseUnitValue) / 1e-12d,
- AmountOfSubstanceUnit.PoundMole => baseUnitValue / 453.59237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AmountOfSubstanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this AmountOfSubstance to another AmountOfSubstance with the unit representation .
+ ///
+ /// A AmountOfSubstance with the specified unit.
+ public AmountOfSubstance ToUnit(AmountOfSubstanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new AmountOfSubstance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AmountOfSubstanceUnit.Centimole => (_value) * 1e-2d,
+ AmountOfSubstanceUnit.CentipoundMole => (_value * 453.59237) * 1e-2d,
+ AmountOfSubstanceUnit.Decimole => (_value) * 1e-1d,
+ AmountOfSubstanceUnit.DecipoundMole => (_value * 453.59237) * 1e-1d,
+ AmountOfSubstanceUnit.Femtomole => (_value) * 1e-15d,
+ AmountOfSubstanceUnit.Kilomole => (_value) * 1e3d,
+ AmountOfSubstanceUnit.KilopoundMole => (_value * 453.59237) * 1e3d,
+ AmountOfSubstanceUnit.Megamole => (_value) * 1e6d,
+ AmountOfSubstanceUnit.Micromole => (_value) * 1e-6d,
+ AmountOfSubstanceUnit.MicropoundMole => (_value * 453.59237) * 1e-6d,
+ AmountOfSubstanceUnit.Millimole => (_value) * 1e-3d,
+ AmountOfSubstanceUnit.MillipoundMole => (_value * 453.59237) * 1e-3d,
+ AmountOfSubstanceUnit.Mole => _value,
+ AmountOfSubstanceUnit.Nanomole => (_value) * 1e-9d,
+ AmountOfSubstanceUnit.NanopoundMole => (_value * 453.59237) * 1e-9d,
+ AmountOfSubstanceUnit.Picomole => (_value) * 1e-12d,
+ AmountOfSubstanceUnit.PoundMole => _value * 453.59237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AmountOfSubstanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AmountOfSubstanceUnit.Centimole => (baseUnitValue) / 1e-2d,
+ AmountOfSubstanceUnit.CentipoundMole => (baseUnitValue / 453.59237) / 1e-2d,
+ AmountOfSubstanceUnit.Decimole => (baseUnitValue) / 1e-1d,
+ AmountOfSubstanceUnit.DecipoundMole => (baseUnitValue / 453.59237) / 1e-1d,
+ AmountOfSubstanceUnit.Femtomole => (baseUnitValue) / 1e-15d,
+ AmountOfSubstanceUnit.Kilomole => (baseUnitValue) / 1e3d,
+ AmountOfSubstanceUnit.KilopoundMole => (baseUnitValue / 453.59237) / 1e3d,
+ AmountOfSubstanceUnit.Megamole => (baseUnitValue) / 1e6d,
+ AmountOfSubstanceUnit.Micromole => (baseUnitValue) / 1e-6d,
+ AmountOfSubstanceUnit.MicropoundMole => (baseUnitValue / 453.59237) / 1e-6d,
+ AmountOfSubstanceUnit.Millimole => (baseUnitValue) / 1e-3d,
+ AmountOfSubstanceUnit.MillipoundMole => (baseUnitValue / 453.59237) / 1e-3d,
+ AmountOfSubstanceUnit.Mole => baseUnitValue,
+ AmountOfSubstanceUnit.Nanomole => (baseUnitValue) / 1e-9d,
+ AmountOfSubstanceUnit.NanopoundMole => (baseUnitValue / 453.59237) / 1e-9d,
+ AmountOfSubstanceUnit.Picomole => (baseUnitValue) / 1e-12d,
+ AmountOfSubstanceUnit.PoundMole => baseUnitValue / 453.59237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmplitudeRatio.g.cs
index ed64c7755c..8a5d5f1618 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmplitudeRatio.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AmplitudeRatio.g.cs
@@ -135,59 +135,59 @@ public static AmplitudeRatio From(double value, AmplitudeRatioUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AmplitudeRatioUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this AmplitudeRatio to another AmplitudeRatio with the unit representation .
- ///
- /// A AmplitudeRatio with the specified unit.
- public AmplitudeRatio ToUnit(AmplitudeRatioUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new AmplitudeRatio(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AmplitudeRatioUnit.DecibelMicrovolt => _value - 120,
- AmplitudeRatioUnit.DecibelMillivolt => _value - 60,
- AmplitudeRatioUnit.DecibelUnloaded => _value - 2.218487499,
- AmplitudeRatioUnit.DecibelVolt => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AmplitudeRatioUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AmplitudeRatioUnit.DecibelMicrovolt => baseUnitValue + 120,
- AmplitudeRatioUnit.DecibelMillivolt => baseUnitValue + 60,
- AmplitudeRatioUnit.DecibelUnloaded => baseUnitValue + 2.218487499,
- AmplitudeRatioUnit.DecibelVolt => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AmplitudeRatioUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this AmplitudeRatio to another AmplitudeRatio with the unit representation .
+ ///
+ /// A AmplitudeRatio with the specified unit.
+ public AmplitudeRatio ToUnit(AmplitudeRatioUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new AmplitudeRatio(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AmplitudeRatioUnit.DecibelMicrovolt => _value - 120,
+ AmplitudeRatioUnit.DecibelMillivolt => _value - 60,
+ AmplitudeRatioUnit.DecibelUnloaded => _value - 2.218487499,
+ AmplitudeRatioUnit.DecibelVolt => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AmplitudeRatioUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AmplitudeRatioUnit.DecibelMicrovolt => baseUnitValue + 120,
+ AmplitudeRatioUnit.DecibelMillivolt => baseUnitValue + 60,
+ AmplitudeRatioUnit.DecibelUnloaded => baseUnitValue + 2.218487499,
+ AmplitudeRatioUnit.DecibelVolt => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Angle.g.cs
index dbe2db2d93..3185933333 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Angle.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Angle.g.cs
@@ -245,81 +245,81 @@ public static Angle From(double value, AngleUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AngleUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Angle to another Angle with the unit representation .
- ///
- /// A Angle with the specified unit.
- public Angle ToUnit(AngleUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Angle(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AngleUnit.Arcminute => _value * 3.1415926535897931 / (60 * 180),
- AngleUnit.Arcsecond => _value * 3.1415926535897931 / (3600 * 180),
- AngleUnit.Centiradian => (_value) * 1e-2d,
- AngleUnit.Deciradian => (_value) * 1e-1d,
- AngleUnit.Degree => _value * 3.1415926535897931 / 180,
- AngleUnit.Gradian => _value * 3.1415926535897931 / 200,
- AngleUnit.Microdegree => (_value * 3.1415926535897931 / 180) * 1e-6d,
- AngleUnit.Microradian => (_value) * 1e-6d,
- AngleUnit.Millidegree => (_value * 3.1415926535897931 / 180) * 1e-3d,
- AngleUnit.Milliradian => (_value) * 1e-3d,
- AngleUnit.Nanodegree => (_value * 3.1415926535897931 / 180) * 1e-9d,
- AngleUnit.Nanoradian => (_value) * 1e-9d,
- AngleUnit.NatoMil => _value * 3.1415926535897931 / 3200,
- AngleUnit.Radian => _value,
- AngleUnit.Revolution => _value * 2 * 3.1415926535897931,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AngleUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AngleUnit.Arcminute => baseUnitValue * 60 * 180 / 3.1415926535897931,
- AngleUnit.Arcsecond => baseUnitValue * 3600 * 180 / 3.1415926535897931,
- AngleUnit.Centiradian => (baseUnitValue) / 1e-2d,
- AngleUnit.Deciradian => (baseUnitValue) / 1e-1d,
- AngleUnit.Degree => baseUnitValue * 180 / 3.1415926535897931,
- AngleUnit.Gradian => baseUnitValue * 200 / 3.1415926535897931,
- AngleUnit.Microdegree => (baseUnitValue * 180 / 3.1415926535897931) / 1e-6d,
- AngleUnit.Microradian => (baseUnitValue) / 1e-6d,
- AngleUnit.Millidegree => (baseUnitValue * 180 / 3.1415926535897931) / 1e-3d,
- AngleUnit.Milliradian => (baseUnitValue) / 1e-3d,
- AngleUnit.Nanodegree => (baseUnitValue * 180 / 3.1415926535897931) / 1e-9d,
- AngleUnit.Nanoradian => (baseUnitValue) / 1e-9d,
- AngleUnit.NatoMil => baseUnitValue * 3200 / 3.1415926535897931,
- AngleUnit.Radian => baseUnitValue,
- AngleUnit.Revolution => baseUnitValue / (2 * 3.1415926535897931),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AngleUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Angle to another Angle with the unit representation .
+ ///
+ /// A Angle with the specified unit.
+ public Angle ToUnit(AngleUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Angle(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AngleUnit.Arcminute => _value * 3.1415926535897931 / (60 * 180),
+ AngleUnit.Arcsecond => _value * 3.1415926535897931 / (3600 * 180),
+ AngleUnit.Centiradian => (_value) * 1e-2d,
+ AngleUnit.Deciradian => (_value) * 1e-1d,
+ AngleUnit.Degree => _value * 3.1415926535897931 / 180,
+ AngleUnit.Gradian => _value * 3.1415926535897931 / 200,
+ AngleUnit.Microdegree => (_value * 3.1415926535897931 / 180) * 1e-6d,
+ AngleUnit.Microradian => (_value) * 1e-6d,
+ AngleUnit.Millidegree => (_value * 3.1415926535897931 / 180) * 1e-3d,
+ AngleUnit.Milliradian => (_value) * 1e-3d,
+ AngleUnit.Nanodegree => (_value * 3.1415926535897931 / 180) * 1e-9d,
+ AngleUnit.Nanoradian => (_value) * 1e-9d,
+ AngleUnit.NatoMil => _value * 3.1415926535897931 / 3200,
+ AngleUnit.Radian => _value,
+ AngleUnit.Revolution => _value * 2 * 3.1415926535897931,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AngleUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AngleUnit.Arcminute => baseUnitValue * 60 * 180 / 3.1415926535897931,
+ AngleUnit.Arcsecond => baseUnitValue * 3600 * 180 / 3.1415926535897931,
+ AngleUnit.Centiradian => (baseUnitValue) / 1e-2d,
+ AngleUnit.Deciradian => (baseUnitValue) / 1e-1d,
+ AngleUnit.Degree => baseUnitValue * 180 / 3.1415926535897931,
+ AngleUnit.Gradian => baseUnitValue * 200 / 3.1415926535897931,
+ AngleUnit.Microdegree => (baseUnitValue * 180 / 3.1415926535897931) / 1e-6d,
+ AngleUnit.Microradian => (baseUnitValue) / 1e-6d,
+ AngleUnit.Millidegree => (baseUnitValue * 180 / 3.1415926535897931) / 1e-3d,
+ AngleUnit.Milliradian => (baseUnitValue) / 1e-3d,
+ AngleUnit.Nanodegree => (baseUnitValue * 180 / 3.1415926535897931) / 1e-9d,
+ AngleUnit.Nanoradian => (baseUnitValue) / 1e-9d,
+ AngleUnit.NatoMil => baseUnitValue * 3200 / 3.1415926535897931,
+ AngleUnit.Radian => baseUnitValue,
+ AngleUnit.Revolution => baseUnitValue / (2 * 3.1415926535897931),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Area.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Area.g.cs
index 36d759bc12..ff4de84e74 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Area.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Area.g.cs
@@ -235,79 +235,79 @@ public static Area From(double value, AreaUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AreaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Area to another Area with the unit representation .
- ///
- /// A Area with the specified unit.
- public Area ToUnit(AreaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Area(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AreaUnit.Acre => _value * 4046.8564224,
- AreaUnit.Hectare => _value * 1e4,
- AreaUnit.SquareCentimeter => _value * 1e-4,
- AreaUnit.SquareDecimeter => _value * 1e-2,
- AreaUnit.SquareFoot => _value * 9.290304e-2,
- AreaUnit.SquareInch => _value * 0.00064516,
- AreaUnit.SquareKilometer => _value * 1e6,
- AreaUnit.SquareMeter => _value,
- AreaUnit.SquareMicrometer => _value * 1e-12,
- AreaUnit.SquareMile => _value * 1609.344 * 1609.344,
- AreaUnit.SquareMillimeter => _value * 1e-6,
- AreaUnit.SquareNauticalMile => _value * 3429904,
- AreaUnit.SquareYard => _value * 0.9144 * 0.9144,
- AreaUnit.UsSurveySquareFoot => _value * (1200.0 / 3937.0) * (1200.0 / 3937.0),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AreaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AreaUnit.Acre => baseUnitValue / 4046.8564224,
- AreaUnit.Hectare => baseUnitValue / 1e4,
- AreaUnit.SquareCentimeter => baseUnitValue / 1e-4,
- AreaUnit.SquareDecimeter => baseUnitValue / 1e-2,
- AreaUnit.SquareFoot => baseUnitValue / 9.290304e-2,
- AreaUnit.SquareInch => baseUnitValue / 0.00064516,
- AreaUnit.SquareKilometer => baseUnitValue / 1e6,
- AreaUnit.SquareMeter => baseUnitValue,
- AreaUnit.SquareMicrometer => baseUnitValue / 1e-12,
- AreaUnit.SquareMile => baseUnitValue / 1609.344 / 1609.344,
- AreaUnit.SquareMillimeter => baseUnitValue / 1e-6,
- AreaUnit.SquareNauticalMile => baseUnitValue / 3429904,
- AreaUnit.SquareYard => baseUnitValue / 0.9144 / 0.9144,
- AreaUnit.UsSurveySquareFoot => baseUnitValue / (1200.0 / 3937.0) / (1200.0 / 3937.0),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AreaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Area to another Area with the unit representation .
+ ///
+ /// A Area with the specified unit.
+ public Area ToUnit(AreaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Area(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AreaUnit.Acre => _value * 4046.8564224,
+ AreaUnit.Hectare => _value * 1e4,
+ AreaUnit.SquareCentimeter => _value * 1e-4,
+ AreaUnit.SquareDecimeter => _value * 1e-2,
+ AreaUnit.SquareFoot => _value * 9.290304e-2,
+ AreaUnit.SquareInch => _value * 0.00064516,
+ AreaUnit.SquareKilometer => _value * 1e6,
+ AreaUnit.SquareMeter => _value,
+ AreaUnit.SquareMicrometer => _value * 1e-12,
+ AreaUnit.SquareMile => _value * 1609.344 * 1609.344,
+ AreaUnit.SquareMillimeter => _value * 1e-6,
+ AreaUnit.SquareNauticalMile => _value * 3429904,
+ AreaUnit.SquareYard => _value * 0.9144 * 0.9144,
+ AreaUnit.UsSurveySquareFoot => _value * (1200.0 / 3937.0) * (1200.0 / 3937.0),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AreaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AreaUnit.Acre => baseUnitValue / 4046.8564224,
+ AreaUnit.Hectare => baseUnitValue / 1e4,
+ AreaUnit.SquareCentimeter => baseUnitValue / 1e-4,
+ AreaUnit.SquareDecimeter => baseUnitValue / 1e-2,
+ AreaUnit.SquareFoot => baseUnitValue / 9.290304e-2,
+ AreaUnit.SquareInch => baseUnitValue / 0.00064516,
+ AreaUnit.SquareKilometer => baseUnitValue / 1e6,
+ AreaUnit.SquareMeter => baseUnitValue,
+ AreaUnit.SquareMicrometer => baseUnitValue / 1e-12,
+ AreaUnit.SquareMile => baseUnitValue / 1609.344 / 1609.344,
+ AreaUnit.SquareMillimeter => baseUnitValue / 1e-6,
+ AreaUnit.SquareNauticalMile => baseUnitValue / 3429904,
+ AreaUnit.SquareYard => baseUnitValue / 0.9144 / 0.9144,
+ AreaUnit.UsSurveySquareFoot => baseUnitValue / (1200.0 / 3937.0) / (1200.0 / 3937.0),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaDensity.g.cs
index 5ba01d91a1..9fe7033910 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaDensity.g.cs
@@ -125,57 +125,57 @@ public static AreaDensity From(double value, AreaDensityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AreaDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this AreaDensity to another AreaDensity with the unit representation .
- ///
- /// A AreaDensity with the specified unit.
- public AreaDensity ToUnit(AreaDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new AreaDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AreaDensityUnit.GramPerSquareMeter => _value / 1000,
- AreaDensityUnit.KilogramPerSquareMeter => _value,
- AreaDensityUnit.MilligramPerSquareMeter => _value / 1000000,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AreaDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AreaDensityUnit.GramPerSquareMeter => baseUnitValue * 1000,
- AreaDensityUnit.KilogramPerSquareMeter => baseUnitValue,
- AreaDensityUnit.MilligramPerSquareMeter => baseUnitValue * 1000000,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AreaDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this AreaDensity to another AreaDensity with the unit representation .
+ ///
+ /// A AreaDensity with the specified unit.
+ public AreaDensity ToUnit(AreaDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new AreaDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AreaDensityUnit.GramPerSquareMeter => _value / 1000,
+ AreaDensityUnit.KilogramPerSquareMeter => _value,
+ AreaDensityUnit.MilligramPerSquareMeter => _value / 1000000,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AreaDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AreaDensityUnit.GramPerSquareMeter => baseUnitValue * 1000,
+ AreaDensityUnit.KilogramPerSquareMeter => baseUnitValue,
+ AreaDensityUnit.MilligramPerSquareMeter => baseUnitValue * 1000000,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs
index 6ab4662f32..2d0cb589bb 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs
@@ -155,63 +155,63 @@ public static AreaMomentOfInertia From(double value, AreaMomentOfInertiaUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(AreaMomentOfInertiaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this AreaMomentOfInertia to another AreaMomentOfInertia with the unit representation .
- ///
- /// A AreaMomentOfInertia with the specified unit.
- public AreaMomentOfInertia ToUnit(AreaMomentOfInertiaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new AreaMomentOfInertia(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- AreaMomentOfInertiaUnit.CentimeterToTheFourth => _value / 1e8,
- AreaMomentOfInertiaUnit.DecimeterToTheFourth => _value / 1e4,
- AreaMomentOfInertiaUnit.FootToTheFourth => _value * 0.0086309748412416,
- AreaMomentOfInertiaUnit.InchToTheFourth => _value * 0.0000004162314256,
- AreaMomentOfInertiaUnit.MeterToTheFourth => _value,
- AreaMomentOfInertiaUnit.MillimeterToTheFourth => _value / 1e12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(AreaMomentOfInertiaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- AreaMomentOfInertiaUnit.CentimeterToTheFourth => baseUnitValue * 1e8,
- AreaMomentOfInertiaUnit.DecimeterToTheFourth => baseUnitValue * 1e4,
- AreaMomentOfInertiaUnit.FootToTheFourth => baseUnitValue / 0.0086309748412416,
- AreaMomentOfInertiaUnit.InchToTheFourth => baseUnitValue / 0.0000004162314256,
- AreaMomentOfInertiaUnit.MeterToTheFourth => baseUnitValue,
- AreaMomentOfInertiaUnit.MillimeterToTheFourth => baseUnitValue * 1e12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(AreaMomentOfInertiaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this AreaMomentOfInertia to another AreaMomentOfInertia with the unit representation .
+ ///
+ /// A AreaMomentOfInertia with the specified unit.
+ public AreaMomentOfInertia ToUnit(AreaMomentOfInertiaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new AreaMomentOfInertia(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ AreaMomentOfInertiaUnit.CentimeterToTheFourth => _value / 1e8,
+ AreaMomentOfInertiaUnit.DecimeterToTheFourth => _value / 1e4,
+ AreaMomentOfInertiaUnit.FootToTheFourth => _value * 0.0086309748412416,
+ AreaMomentOfInertiaUnit.InchToTheFourth => _value * 0.0000004162314256,
+ AreaMomentOfInertiaUnit.MeterToTheFourth => _value,
+ AreaMomentOfInertiaUnit.MillimeterToTheFourth => _value / 1e12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(AreaMomentOfInertiaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ AreaMomentOfInertiaUnit.CentimeterToTheFourth => baseUnitValue * 1e8,
+ AreaMomentOfInertiaUnit.DecimeterToTheFourth => baseUnitValue * 1e4,
+ AreaMomentOfInertiaUnit.FootToTheFourth => baseUnitValue / 0.0086309748412416,
+ AreaMomentOfInertiaUnit.InchToTheFourth => baseUnitValue / 0.0000004162314256,
+ AreaMomentOfInertiaUnit.MeterToTheFourth => baseUnitValue,
+ AreaMomentOfInertiaUnit.MillimeterToTheFourth => baseUnitValue * 1e12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/BitRate.g.cs
index 1e0227f51f..c2c282bdcf 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/BitRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/BitRate.g.cs
@@ -488,129 +488,129 @@ public static BitRate From(double value, BitRateUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(BitRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this BitRate to another BitRate with the unit representation .
- ///
- /// A BitRate with the specified unit.
- public BitRate ToUnit(BitRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new BitRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- BitRateUnit.BitPerSecond => _value,
- BitRateUnit.BytePerSecond => _value * 8,
- BitRateUnit.ExabitPerSecond => (_value) * 1e18d,
- BitRateUnit.ExabytePerSecond => (_value * 8) * 1e18d,
- BitRateUnit.ExaoctetPerSecond => (_value * 8) * 1e18d,
- BitRateUnit.ExbibitPerSecond => (_value) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.ExbibytePerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.ExbioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.GibibitPerSecond => (_value) * (1024d * 1024 * 1024),
- BitRateUnit.GibibytePerSecond => (_value * 8) * (1024d * 1024 * 1024),
- BitRateUnit.GibioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024),
- BitRateUnit.GigabitPerSecond => (_value) * 1e9d,
- BitRateUnit.GigabytePerSecond => (_value * 8) * 1e9d,
- BitRateUnit.GigaoctetPerSecond => (_value * 8) * 1e9d,
- BitRateUnit.KibibitPerSecond => (_value) * 1024d,
- BitRateUnit.KibibytePerSecond => (_value * 8) * 1024d,
- BitRateUnit.KibioctetPerSecond => (_value * 8) * 1024d,
- BitRateUnit.KilobitPerSecond => (_value) * 1e3d,
- BitRateUnit.KilobytePerSecond => (_value * 8) * 1e3d,
- BitRateUnit.KilooctetPerSecond => (_value * 8) * 1e3d,
- BitRateUnit.MebibitPerSecond => (_value) * (1024d * 1024),
- BitRateUnit.MebibytePerSecond => (_value * 8) * (1024d * 1024),
- BitRateUnit.MebioctetPerSecond => (_value * 8) * (1024d * 1024),
- BitRateUnit.MegabitPerSecond => (_value) * 1e6d,
- BitRateUnit.MegabytePerSecond => (_value * 8) * 1e6d,
- BitRateUnit.MegaoctetPerSecond => (_value * 8) * 1e6d,
- BitRateUnit.OctetPerSecond => _value * 8,
- BitRateUnit.PebibitPerSecond => (_value) * (1024d * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.PebibytePerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.PebioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.PetabitPerSecond => (_value) * 1e15d,
- BitRateUnit.PetabytePerSecond => (_value * 8) * 1e15d,
- BitRateUnit.PetaoctetPerSecond => (_value * 8) * 1e15d,
- BitRateUnit.TebibitPerSecond => (_value) * (1024d * 1024 * 1024 * 1024),
- BitRateUnit.TebibytePerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024),
- BitRateUnit.TebioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024),
- BitRateUnit.TerabitPerSecond => (_value) * 1e12d,
- BitRateUnit.TerabytePerSecond => (_value * 8) * 1e12d,
- BitRateUnit.TeraoctetPerSecond => (_value * 8) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(BitRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- BitRateUnit.BitPerSecond => baseUnitValue,
- BitRateUnit.BytePerSecond => baseUnitValue / 8,
- BitRateUnit.ExabitPerSecond => (baseUnitValue) / 1e18d,
- BitRateUnit.ExabytePerSecond => (baseUnitValue / 8) / 1e18d,
- BitRateUnit.ExaoctetPerSecond => (baseUnitValue / 8) / 1e18d,
- BitRateUnit.ExbibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.ExbibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.ExbioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.GibibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024),
- BitRateUnit.GibibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024),
- BitRateUnit.GibioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024),
- BitRateUnit.GigabitPerSecond => (baseUnitValue) / 1e9d,
- BitRateUnit.GigabytePerSecond => (baseUnitValue / 8) / 1e9d,
- BitRateUnit.GigaoctetPerSecond => (baseUnitValue / 8) / 1e9d,
- BitRateUnit.KibibitPerSecond => (baseUnitValue) / 1024d,
- BitRateUnit.KibibytePerSecond => (baseUnitValue / 8) / 1024d,
- BitRateUnit.KibioctetPerSecond => (baseUnitValue / 8) / 1024d,
- BitRateUnit.KilobitPerSecond => (baseUnitValue) / 1e3d,
- BitRateUnit.KilobytePerSecond => (baseUnitValue / 8) / 1e3d,
- BitRateUnit.KilooctetPerSecond => (baseUnitValue / 8) / 1e3d,
- BitRateUnit.MebibitPerSecond => (baseUnitValue) / (1024d * 1024),
- BitRateUnit.MebibytePerSecond => (baseUnitValue / 8) / (1024d * 1024),
- BitRateUnit.MebioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024),
- BitRateUnit.MegabitPerSecond => (baseUnitValue) / 1e6d,
- BitRateUnit.MegabytePerSecond => (baseUnitValue / 8) / 1e6d,
- BitRateUnit.MegaoctetPerSecond => (baseUnitValue / 8) / 1e6d,
- BitRateUnit.OctetPerSecond => baseUnitValue / 8,
- BitRateUnit.PebibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.PebibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.PebioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
- BitRateUnit.PetabitPerSecond => (baseUnitValue) / 1e15d,
- BitRateUnit.PetabytePerSecond => (baseUnitValue / 8) / 1e15d,
- BitRateUnit.PetaoctetPerSecond => (baseUnitValue / 8) / 1e15d,
- BitRateUnit.TebibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024 * 1024),
- BitRateUnit.TebibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
- BitRateUnit.TebioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
- BitRateUnit.TerabitPerSecond => (baseUnitValue) / 1e12d,
- BitRateUnit.TerabytePerSecond => (baseUnitValue / 8) / 1e12d,
- BitRateUnit.TeraoctetPerSecond => (baseUnitValue / 8) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(BitRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this BitRate to another BitRate with the unit representation .
+ ///
+ /// A BitRate with the specified unit.
+ public BitRate ToUnit(BitRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new BitRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ BitRateUnit.BitPerSecond => _value,
+ BitRateUnit.BytePerSecond => _value * 8,
+ BitRateUnit.ExabitPerSecond => (_value) * 1e18d,
+ BitRateUnit.ExabytePerSecond => (_value * 8) * 1e18d,
+ BitRateUnit.ExaoctetPerSecond => (_value * 8) * 1e18d,
+ BitRateUnit.ExbibitPerSecond => (_value) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.ExbibytePerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.ExbioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.GibibitPerSecond => (_value) * (1024d * 1024 * 1024),
+ BitRateUnit.GibibytePerSecond => (_value * 8) * (1024d * 1024 * 1024),
+ BitRateUnit.GibioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024),
+ BitRateUnit.GigabitPerSecond => (_value) * 1e9d,
+ BitRateUnit.GigabytePerSecond => (_value * 8) * 1e9d,
+ BitRateUnit.GigaoctetPerSecond => (_value * 8) * 1e9d,
+ BitRateUnit.KibibitPerSecond => (_value) * 1024d,
+ BitRateUnit.KibibytePerSecond => (_value * 8) * 1024d,
+ BitRateUnit.KibioctetPerSecond => (_value * 8) * 1024d,
+ BitRateUnit.KilobitPerSecond => (_value) * 1e3d,
+ BitRateUnit.KilobytePerSecond => (_value * 8) * 1e3d,
+ BitRateUnit.KilooctetPerSecond => (_value * 8) * 1e3d,
+ BitRateUnit.MebibitPerSecond => (_value) * (1024d * 1024),
+ BitRateUnit.MebibytePerSecond => (_value * 8) * (1024d * 1024),
+ BitRateUnit.MebioctetPerSecond => (_value * 8) * (1024d * 1024),
+ BitRateUnit.MegabitPerSecond => (_value) * 1e6d,
+ BitRateUnit.MegabytePerSecond => (_value * 8) * 1e6d,
+ BitRateUnit.MegaoctetPerSecond => (_value * 8) * 1e6d,
+ BitRateUnit.OctetPerSecond => _value * 8,
+ BitRateUnit.PebibitPerSecond => (_value) * (1024d * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.PebibytePerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.PebioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.PetabitPerSecond => (_value) * 1e15d,
+ BitRateUnit.PetabytePerSecond => (_value * 8) * 1e15d,
+ BitRateUnit.PetaoctetPerSecond => (_value * 8) * 1e15d,
+ BitRateUnit.TebibitPerSecond => (_value) * (1024d * 1024 * 1024 * 1024),
+ BitRateUnit.TebibytePerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024),
+ BitRateUnit.TebioctetPerSecond => (_value * 8) * (1024d * 1024 * 1024 * 1024),
+ BitRateUnit.TerabitPerSecond => (_value) * 1e12d,
+ BitRateUnit.TerabytePerSecond => (_value * 8) * 1e12d,
+ BitRateUnit.TeraoctetPerSecond => (_value * 8) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(BitRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ BitRateUnit.BitPerSecond => baseUnitValue,
+ BitRateUnit.BytePerSecond => baseUnitValue / 8,
+ BitRateUnit.ExabitPerSecond => (baseUnitValue) / 1e18d,
+ BitRateUnit.ExabytePerSecond => (baseUnitValue / 8) / 1e18d,
+ BitRateUnit.ExaoctetPerSecond => (baseUnitValue / 8) / 1e18d,
+ BitRateUnit.ExbibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.ExbibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.ExbioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.GibibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024),
+ BitRateUnit.GibibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024),
+ BitRateUnit.GibioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024),
+ BitRateUnit.GigabitPerSecond => (baseUnitValue) / 1e9d,
+ BitRateUnit.GigabytePerSecond => (baseUnitValue / 8) / 1e9d,
+ BitRateUnit.GigaoctetPerSecond => (baseUnitValue / 8) / 1e9d,
+ BitRateUnit.KibibitPerSecond => (baseUnitValue) / 1024d,
+ BitRateUnit.KibibytePerSecond => (baseUnitValue / 8) / 1024d,
+ BitRateUnit.KibioctetPerSecond => (baseUnitValue / 8) / 1024d,
+ BitRateUnit.KilobitPerSecond => (baseUnitValue) / 1e3d,
+ BitRateUnit.KilobytePerSecond => (baseUnitValue / 8) / 1e3d,
+ BitRateUnit.KilooctetPerSecond => (baseUnitValue / 8) / 1e3d,
+ BitRateUnit.MebibitPerSecond => (baseUnitValue) / (1024d * 1024),
+ BitRateUnit.MebibytePerSecond => (baseUnitValue / 8) / (1024d * 1024),
+ BitRateUnit.MebioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024),
+ BitRateUnit.MegabitPerSecond => (baseUnitValue) / 1e6d,
+ BitRateUnit.MegabytePerSecond => (baseUnitValue / 8) / 1e6d,
+ BitRateUnit.MegaoctetPerSecond => (baseUnitValue / 8) / 1e6d,
+ BitRateUnit.OctetPerSecond => baseUnitValue / 8,
+ BitRateUnit.PebibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.PebibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.PebioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
+ BitRateUnit.PetabitPerSecond => (baseUnitValue) / 1e15d,
+ BitRateUnit.PetabytePerSecond => (baseUnitValue / 8) / 1e15d,
+ BitRateUnit.PetaoctetPerSecond => (baseUnitValue / 8) / 1e15d,
+ BitRateUnit.TebibitPerSecond => (baseUnitValue) / (1024d * 1024 * 1024 * 1024),
+ BitRateUnit.TebibytePerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
+ BitRateUnit.TebioctetPerSecond => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
+ BitRateUnit.TerabitPerSecond => (baseUnitValue) / 1e12d,
+ BitRateUnit.TerabytePerSecond => (baseUnitValue / 8) / 1e12d,
+ BitRateUnit.TeraoctetPerSecond => (baseUnitValue / 8) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs
index 8b57427c8d..4aae3aa83b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs
@@ -125,57 +125,57 @@ public static BrakeSpecificFuelConsumption From(double value, BrakeSpecificFuelC
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(BrakeSpecificFuelConsumptionUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this BrakeSpecificFuelConsumption to another BrakeSpecificFuelConsumption with the unit representation .
- ///
- /// A BrakeSpecificFuelConsumption with the specified unit.
- public BrakeSpecificFuelConsumption ToUnit(BrakeSpecificFuelConsumptionUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new BrakeSpecificFuelConsumption(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour => _value / 3.6e9,
- BrakeSpecificFuelConsumptionUnit.KilogramPerJoule => _value,
- BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour => _value * (0.45359237 / (76.0402249 * 9.80665))/3600,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(BrakeSpecificFuelConsumptionUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour => baseUnitValue * 3.6e9,
- BrakeSpecificFuelConsumptionUnit.KilogramPerJoule => baseUnitValue,
- BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour => baseUnitValue * 3600 / (0.45359237 / (76.0402249 * 9.80665)),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(BrakeSpecificFuelConsumptionUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this BrakeSpecificFuelConsumption to another BrakeSpecificFuelConsumption with the unit representation .
+ ///
+ /// A BrakeSpecificFuelConsumption with the specified unit.
+ public BrakeSpecificFuelConsumption ToUnit(BrakeSpecificFuelConsumptionUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new BrakeSpecificFuelConsumption(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour => _value / 3.6e9,
+ BrakeSpecificFuelConsumptionUnit.KilogramPerJoule => _value,
+ BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour => _value * (0.45359237 / (76.0402249 * 9.80665))/3600,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(BrakeSpecificFuelConsumptionUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ BrakeSpecificFuelConsumptionUnit.GramPerKiloWattHour => baseUnitValue * 3.6e9,
+ BrakeSpecificFuelConsumptionUnit.KilogramPerJoule => baseUnitValue,
+ BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour => baseUnitValue * 3600 / (0.45359237 / (76.0402249 * 9.80665)),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs
index 473f9bf1cd..19e9cc1dcb 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs
@@ -155,63 +155,63 @@ public static CoefficientOfThermalExpansion From(double value, CoefficientOfTher
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(CoefficientOfThermalExpansionUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this CoefficientOfThermalExpansion to another CoefficientOfThermalExpansion with the unit representation .
- ///
- /// A CoefficientOfThermalExpansion with the specified unit.
- public CoefficientOfThermalExpansion ToUnit(CoefficientOfThermalExpansionUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new CoefficientOfThermalExpansion(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- CoefficientOfThermalExpansionUnit.PerDegreeCelsius => _value,
- CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => _value * 9 / 5,
- CoefficientOfThermalExpansionUnit.PerKelvin => _value,
- CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius => _value / 1e6,
- CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit => _value * 9 / 5e6,
- CoefficientOfThermalExpansionUnit.PpmPerKelvin => _value / 1e6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(CoefficientOfThermalExpansionUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- CoefficientOfThermalExpansionUnit.PerDegreeCelsius => baseUnitValue,
- CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => baseUnitValue * 5 / 9,
- CoefficientOfThermalExpansionUnit.PerKelvin => baseUnitValue,
- CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius => baseUnitValue * 1e6,
- CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit => baseUnitValue * 5e6 / 9,
- CoefficientOfThermalExpansionUnit.PpmPerKelvin => baseUnitValue * 1e6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(CoefficientOfThermalExpansionUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this CoefficientOfThermalExpansion to another CoefficientOfThermalExpansion with the unit representation .
+ ///
+ /// A CoefficientOfThermalExpansion with the specified unit.
+ public CoefficientOfThermalExpansion ToUnit(CoefficientOfThermalExpansionUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new CoefficientOfThermalExpansion(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ CoefficientOfThermalExpansionUnit.PerDegreeCelsius => _value,
+ CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => _value * 9 / 5,
+ CoefficientOfThermalExpansionUnit.PerKelvin => _value,
+ CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius => _value / 1e6,
+ CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit => _value * 9 / 5e6,
+ CoefficientOfThermalExpansionUnit.PpmPerKelvin => _value / 1e6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(CoefficientOfThermalExpansionUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ CoefficientOfThermalExpansionUnit.PerDegreeCelsius => baseUnitValue,
+ CoefficientOfThermalExpansionUnit.PerDegreeFahrenheit => baseUnitValue * 5 / 9,
+ CoefficientOfThermalExpansionUnit.PerKelvin => baseUnitValue,
+ CoefficientOfThermalExpansionUnit.PpmPerDegreeCelsius => baseUnitValue * 1e6,
+ CoefficientOfThermalExpansionUnit.PpmPerDegreeFahrenheit => baseUnitValue * 5e6 / 9,
+ CoefficientOfThermalExpansionUnit.PpmPerKelvin => baseUnitValue * 1e6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Compressibility.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Compressibility.g.cs
index 03298e9331..6ffbc821ab 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Compressibility.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Compressibility.g.cs
@@ -165,65 +165,65 @@ public static Compressibility From(double value, CompressibilityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(CompressibilityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Compressibility to another Compressibility with the unit representation .
- ///
- /// A Compressibility with the specified unit.
- public Compressibility ToUnit(CompressibilityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Compressibility(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- CompressibilityUnit.InverseAtmosphere => _value * 101325,
- CompressibilityUnit.InverseBar => _value * 1e5,
- CompressibilityUnit.InverseKilopascal => _value * 1e3,
- CompressibilityUnit.InverseMegapascal => _value * 1e6,
- CompressibilityUnit.InverseMillibar => _value * 100,
- CompressibilityUnit.InversePascal => _value,
- CompressibilityUnit.InversePoundForcePerSquareInch => _value * 6.894757293168361e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(CompressibilityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- CompressibilityUnit.InverseAtmosphere => baseUnitValue / 101325,
- CompressibilityUnit.InverseBar => baseUnitValue / 1e5,
- CompressibilityUnit.InverseKilopascal => baseUnitValue / 1e3,
- CompressibilityUnit.InverseMegapascal => baseUnitValue / 1e6,
- CompressibilityUnit.InverseMillibar => baseUnitValue / 100,
- CompressibilityUnit.InversePascal => baseUnitValue,
- CompressibilityUnit.InversePoundForcePerSquareInch => baseUnitValue / 6.894757293168361e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(CompressibilityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Compressibility to another Compressibility with the unit representation .
+ ///
+ /// A Compressibility with the specified unit.
+ public Compressibility ToUnit(CompressibilityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Compressibility(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ CompressibilityUnit.InverseAtmosphere => _value * 101325,
+ CompressibilityUnit.InverseBar => _value * 1e5,
+ CompressibilityUnit.InverseKilopascal => _value * 1e3,
+ CompressibilityUnit.InverseMegapascal => _value * 1e6,
+ CompressibilityUnit.InverseMillibar => _value * 100,
+ CompressibilityUnit.InversePascal => _value,
+ CompressibilityUnit.InversePoundForcePerSquareInch => _value * 6.894757293168361e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(CompressibilityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ CompressibilityUnit.InverseAtmosphere => baseUnitValue / 101325,
+ CompressibilityUnit.InverseBar => baseUnitValue / 1e5,
+ CompressibilityUnit.InverseKilopascal => baseUnitValue / 1e3,
+ CompressibilityUnit.InverseMegapascal => baseUnitValue / 1e6,
+ CompressibilityUnit.InverseMillibar => baseUnitValue / 100,
+ CompressibilityUnit.InversePascal => baseUnitValue,
+ CompressibilityUnit.InversePoundForcePerSquareInch => baseUnitValue / 6.894757293168361e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs
index 069b1d250f..c0458df116 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Density.g.cs
@@ -658,163 +658,163 @@ public static Density From(double value, DensityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(DensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Density to another Density with the unit representation .
- ///
- /// A Density with the specified unit.
- public Density ToUnit(DensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Density(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- DensityUnit.CentigramPerDeciliter => (_value / 1e-1) * 1e-2d,
- DensityUnit.CentigramPerLiter => (_value / 1) * 1e-2d,
- DensityUnit.CentigramPerMilliliter => (_value / 1e-3) * 1e-2d,
- DensityUnit.DecigramPerDeciliter => (_value / 1e-1) * 1e-1d,
- DensityUnit.DecigramPerLiter => (_value / 1) * 1e-1d,
- DensityUnit.DecigramPerMilliliter => (_value / 1e-3) * 1e-1d,
- DensityUnit.FemtogramPerDeciliter => (_value / 1e-1) * 1e-15d,
- DensityUnit.FemtogramPerLiter => (_value / 1) * 1e-15d,
- DensityUnit.FemtogramPerMilliliter => (_value / 1e-3) * 1e-15d,
- DensityUnit.GramPerCubicCentimeter => _value / 1e-3,
- DensityUnit.GramPerCubicFoot => _value * 0.001 / 0.028316846592,
- DensityUnit.GramPerCubicInch => _value * 0.001 / 1.6387064e-5,
- DensityUnit.GramPerCubicMeter => _value / 1e3,
- DensityUnit.GramPerCubicMillimeter => _value / 1e-6,
- DensityUnit.GramPerDeciliter => _value / 1e-1,
- DensityUnit.GramPerLiter => _value / 1,
- DensityUnit.GramPerMilliliter => _value / 1e-3,
- DensityUnit.KilogramPerCubicCentimeter => (_value / 1e-3) * 1e3d,
- DensityUnit.KilogramPerCubicMeter => (_value / 1e3) * 1e3d,
- DensityUnit.KilogramPerCubicMillimeter => (_value / 1e-6) * 1e3d,
- DensityUnit.KilogramPerLiter => _value * 1e3,
- DensityUnit.KilopoundPerCubicFoot => (_value * 0.45359237 / 0.028316846592) * 1e3d,
- DensityUnit.KilopoundPerCubicInch => (_value * 0.45359237 / 1.6387064e-5) * 1e3d,
- DensityUnit.KilopoundPerCubicYard => (_value * 0.45359237 / 0.764554857984) * 1e3d,
- DensityUnit.MicrogramPerCubicMeter => (_value / 1e3) * 1e-6d,
- DensityUnit.MicrogramPerDeciliter => (_value / 1e-1) * 1e-6d,
- DensityUnit.MicrogramPerLiter => (_value / 1) * 1e-6d,
- DensityUnit.MicrogramPerMilliliter => (_value / 1e-3) * 1e-6d,
- DensityUnit.MilligramPerCubicMeter => (_value / 1e3) * 1e-3d,
- DensityUnit.MilligramPerDeciliter => (_value / 1e-1) * 1e-3d,
- DensityUnit.MilligramPerLiter => (_value / 1) * 1e-3d,
- DensityUnit.MilligramPerMilliliter => (_value / 1e-3) * 1e-3d,
- DensityUnit.NanogramPerDeciliter => (_value / 1e-1) * 1e-9d,
- DensityUnit.NanogramPerLiter => (_value / 1) * 1e-9d,
- DensityUnit.NanogramPerMilliliter => (_value / 1e-3) * 1e-9d,
- DensityUnit.PicogramPerDeciliter => (_value / 1e-1) * 1e-12d,
- DensityUnit.PicogramPerLiter => (_value / 1) * 1e-12d,
- DensityUnit.PicogramPerMilliliter => (_value / 1e-3) * 1e-12d,
- DensityUnit.PoundPerCubicCentimeter => _value * 0.45359237e6,
- DensityUnit.PoundPerCubicFoot => _value * 0.45359237 / 0.028316846592,
- DensityUnit.PoundPerCubicInch => _value * 0.45359237 / 1.6387064e-5,
- DensityUnit.PoundPerCubicMeter => _value * 0.45359237,
- DensityUnit.PoundPerCubicMillimeter => _value * 0.45359237e9,
- DensityUnit.PoundPerCubicYard => _value * 0.45359237 / 0.764554857984,
- DensityUnit.PoundPerImperialGallon => _value * 0.45359237 / 0.00454609,
- DensityUnit.PoundPerUSGallon => _value * 0.45359237 / 0.003785411784,
- DensityUnit.SlugPerCubicCentimeter => _value * 0.45359237e6 * 9.80665 / 0.3048,
- DensityUnit.SlugPerCubicFoot => _value * (0.45359237 * 9.80665) / (0.3048 * 0.028316846592),
- DensityUnit.SlugPerCubicInch => _value * (0.45359237 * 9.80665) / (0.3048 * 1.6387064e-5),
- DensityUnit.SlugPerCubicMeter => _value * 0.45359237 * 9.80665 / 0.3048,
- DensityUnit.SlugPerCubicMillimeter => _value * 0.45359237e9 * 9.80665 / 0.3048,
- DensityUnit.TonnePerCubicCentimeter => _value / 1e-9,
- DensityUnit.TonnePerCubicFoot => _value * 1000 / 0.028316846592,
- DensityUnit.TonnePerCubicInch => _value * 1000 / 1.6387064e-5,
- DensityUnit.TonnePerCubicMeter => _value / 0.001,
- DensityUnit.TonnePerCubicMillimeter => _value / 1e-12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(DensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- DensityUnit.CentigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-2d,
- DensityUnit.CentigramPerLiter => (baseUnitValue * 1) / 1e-2d,
- DensityUnit.CentigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-2d,
- DensityUnit.DecigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-1d,
- DensityUnit.DecigramPerLiter => (baseUnitValue * 1) / 1e-1d,
- DensityUnit.DecigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-1d,
- DensityUnit.FemtogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-15d,
- DensityUnit.FemtogramPerLiter => (baseUnitValue * 1) / 1e-15d,
- DensityUnit.FemtogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-15d,
- DensityUnit.GramPerCubicCentimeter => baseUnitValue * 1e-3,
- DensityUnit.GramPerCubicFoot => baseUnitValue * 0.028316846592 / 0.001,
- DensityUnit.GramPerCubicInch => baseUnitValue * 1.6387064e-5 / 0.001,
- DensityUnit.GramPerCubicMeter => baseUnitValue * 1e3,
- DensityUnit.GramPerCubicMillimeter => baseUnitValue * 1e-6,
- DensityUnit.GramPerDeciliter => baseUnitValue * 1e-1,
- DensityUnit.GramPerLiter => baseUnitValue * 1,
- DensityUnit.GramPerMilliliter => baseUnitValue * 1e-3,
- DensityUnit.KilogramPerCubicCentimeter => (baseUnitValue * 1e-3) / 1e3d,
- DensityUnit.KilogramPerCubicMeter => (baseUnitValue * 1e3) / 1e3d,
- DensityUnit.KilogramPerCubicMillimeter => (baseUnitValue * 1e-6) / 1e3d,
- DensityUnit.KilogramPerLiter => baseUnitValue / 1e3,
- DensityUnit.KilopoundPerCubicFoot => (baseUnitValue * 0.028316846592 / 0.45359237) / 1e3d,
- DensityUnit.KilopoundPerCubicInch => (baseUnitValue * 1.6387064e-5 / 0.45359237) / 1e3d,
- DensityUnit.KilopoundPerCubicYard => (baseUnitValue * 0.764554857984 / 0.45359237) / 1e3d,
- DensityUnit.MicrogramPerCubicMeter => (baseUnitValue * 1e3) / 1e-6d,
- DensityUnit.MicrogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-6d,
- DensityUnit.MicrogramPerLiter => (baseUnitValue * 1) / 1e-6d,
- DensityUnit.MicrogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-6d,
- DensityUnit.MilligramPerCubicMeter => (baseUnitValue * 1e3) / 1e-3d,
- DensityUnit.MilligramPerDeciliter => (baseUnitValue * 1e-1) / 1e-3d,
- DensityUnit.MilligramPerLiter => (baseUnitValue * 1) / 1e-3d,
- DensityUnit.MilligramPerMilliliter => (baseUnitValue * 1e-3) / 1e-3d,
- DensityUnit.NanogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-9d,
- DensityUnit.NanogramPerLiter => (baseUnitValue * 1) / 1e-9d,
- DensityUnit.NanogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-9d,
- DensityUnit.PicogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-12d,
- DensityUnit.PicogramPerLiter => (baseUnitValue * 1) / 1e-12d,
- DensityUnit.PicogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-12d,
- DensityUnit.PoundPerCubicCentimeter => baseUnitValue / 0.45359237e6,
- DensityUnit.PoundPerCubicFoot => baseUnitValue * 0.028316846592 / 0.45359237,
- DensityUnit.PoundPerCubicInch => baseUnitValue * 1.6387064e-5 / 0.45359237,
- DensityUnit.PoundPerCubicMeter => baseUnitValue / 0.45359237,
- DensityUnit.PoundPerCubicMillimeter => baseUnitValue / 0.45359237e9,
- DensityUnit.PoundPerCubicYard => baseUnitValue * 0.764554857984 / 0.45359237,
- DensityUnit.PoundPerImperialGallon => baseUnitValue * 0.00454609 / 0.45359237,
- DensityUnit.PoundPerUSGallon => baseUnitValue * 0.003785411784 / 0.45359237,
- DensityUnit.SlugPerCubicCentimeter => baseUnitValue * 0.3048 / (0.45359237e6 * 9.80665),
- DensityUnit.SlugPerCubicFoot => baseUnitValue * (0.3048 * 0.028316846592) / (0.45359237 * 9.80665),
- DensityUnit.SlugPerCubicInch => baseUnitValue * (0.3048 * 1.6387064e-5) / (0.45359237 * 9.80665),
- DensityUnit.SlugPerCubicMeter => baseUnitValue * 0.3048 / (0.45359237 * 9.80665),
- DensityUnit.SlugPerCubicMillimeter => baseUnitValue * 0.3048 / (0.45359237e9 * 9.80665),
- DensityUnit.TonnePerCubicCentimeter => baseUnitValue * 1e-9,
- DensityUnit.TonnePerCubicFoot => baseUnitValue * 0.028316846592 / 1000,
- DensityUnit.TonnePerCubicInch => baseUnitValue * 1.6387064e-5 / 1000,
- DensityUnit.TonnePerCubicMeter => baseUnitValue * 0.001,
- DensityUnit.TonnePerCubicMillimeter => baseUnitValue * 1e-12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(DensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Density to another Density with the unit representation .
+ ///
+ /// A Density with the specified unit.
+ public Density ToUnit(DensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Density(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ DensityUnit.CentigramPerDeciliter => (_value / 1e-1) * 1e-2d,
+ DensityUnit.CentigramPerLiter => (_value / 1) * 1e-2d,
+ DensityUnit.CentigramPerMilliliter => (_value / 1e-3) * 1e-2d,
+ DensityUnit.DecigramPerDeciliter => (_value / 1e-1) * 1e-1d,
+ DensityUnit.DecigramPerLiter => (_value / 1) * 1e-1d,
+ DensityUnit.DecigramPerMilliliter => (_value / 1e-3) * 1e-1d,
+ DensityUnit.FemtogramPerDeciliter => (_value / 1e-1) * 1e-15d,
+ DensityUnit.FemtogramPerLiter => (_value / 1) * 1e-15d,
+ DensityUnit.FemtogramPerMilliliter => (_value / 1e-3) * 1e-15d,
+ DensityUnit.GramPerCubicCentimeter => _value / 1e-3,
+ DensityUnit.GramPerCubicFoot => _value * 0.001 / 0.028316846592,
+ DensityUnit.GramPerCubicInch => _value * 0.001 / 1.6387064e-5,
+ DensityUnit.GramPerCubicMeter => _value / 1e3,
+ DensityUnit.GramPerCubicMillimeter => _value / 1e-6,
+ DensityUnit.GramPerDeciliter => _value / 1e-1,
+ DensityUnit.GramPerLiter => _value / 1,
+ DensityUnit.GramPerMilliliter => _value / 1e-3,
+ DensityUnit.KilogramPerCubicCentimeter => (_value / 1e-3) * 1e3d,
+ DensityUnit.KilogramPerCubicMeter => (_value / 1e3) * 1e3d,
+ DensityUnit.KilogramPerCubicMillimeter => (_value / 1e-6) * 1e3d,
+ DensityUnit.KilogramPerLiter => _value * 1e3,
+ DensityUnit.KilopoundPerCubicFoot => (_value * 0.45359237 / 0.028316846592) * 1e3d,
+ DensityUnit.KilopoundPerCubicInch => (_value * 0.45359237 / 1.6387064e-5) * 1e3d,
+ DensityUnit.KilopoundPerCubicYard => (_value * 0.45359237 / 0.764554857984) * 1e3d,
+ DensityUnit.MicrogramPerCubicMeter => (_value / 1e3) * 1e-6d,
+ DensityUnit.MicrogramPerDeciliter => (_value / 1e-1) * 1e-6d,
+ DensityUnit.MicrogramPerLiter => (_value / 1) * 1e-6d,
+ DensityUnit.MicrogramPerMilliliter => (_value / 1e-3) * 1e-6d,
+ DensityUnit.MilligramPerCubicMeter => (_value / 1e3) * 1e-3d,
+ DensityUnit.MilligramPerDeciliter => (_value / 1e-1) * 1e-3d,
+ DensityUnit.MilligramPerLiter => (_value / 1) * 1e-3d,
+ DensityUnit.MilligramPerMilliliter => (_value / 1e-3) * 1e-3d,
+ DensityUnit.NanogramPerDeciliter => (_value / 1e-1) * 1e-9d,
+ DensityUnit.NanogramPerLiter => (_value / 1) * 1e-9d,
+ DensityUnit.NanogramPerMilliliter => (_value / 1e-3) * 1e-9d,
+ DensityUnit.PicogramPerDeciliter => (_value / 1e-1) * 1e-12d,
+ DensityUnit.PicogramPerLiter => (_value / 1) * 1e-12d,
+ DensityUnit.PicogramPerMilliliter => (_value / 1e-3) * 1e-12d,
+ DensityUnit.PoundPerCubicCentimeter => _value * 0.45359237e6,
+ DensityUnit.PoundPerCubicFoot => _value * 0.45359237 / 0.028316846592,
+ DensityUnit.PoundPerCubicInch => _value * 0.45359237 / 1.6387064e-5,
+ DensityUnit.PoundPerCubicMeter => _value * 0.45359237,
+ DensityUnit.PoundPerCubicMillimeter => _value * 0.45359237e9,
+ DensityUnit.PoundPerCubicYard => _value * 0.45359237 / 0.764554857984,
+ DensityUnit.PoundPerImperialGallon => _value * 0.45359237 / 0.00454609,
+ DensityUnit.PoundPerUSGallon => _value * 0.45359237 / 0.003785411784,
+ DensityUnit.SlugPerCubicCentimeter => _value * 0.45359237e6 * 9.80665 / 0.3048,
+ DensityUnit.SlugPerCubicFoot => _value * (0.45359237 * 9.80665) / (0.3048 * 0.028316846592),
+ DensityUnit.SlugPerCubicInch => _value * (0.45359237 * 9.80665) / (0.3048 * 1.6387064e-5),
+ DensityUnit.SlugPerCubicMeter => _value * 0.45359237 * 9.80665 / 0.3048,
+ DensityUnit.SlugPerCubicMillimeter => _value * 0.45359237e9 * 9.80665 / 0.3048,
+ DensityUnit.TonnePerCubicCentimeter => _value / 1e-9,
+ DensityUnit.TonnePerCubicFoot => _value * 1000 / 0.028316846592,
+ DensityUnit.TonnePerCubicInch => _value * 1000 / 1.6387064e-5,
+ DensityUnit.TonnePerCubicMeter => _value / 0.001,
+ DensityUnit.TonnePerCubicMillimeter => _value / 1e-12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(DensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ DensityUnit.CentigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-2d,
+ DensityUnit.CentigramPerLiter => (baseUnitValue * 1) / 1e-2d,
+ DensityUnit.CentigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-2d,
+ DensityUnit.DecigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-1d,
+ DensityUnit.DecigramPerLiter => (baseUnitValue * 1) / 1e-1d,
+ DensityUnit.DecigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-1d,
+ DensityUnit.FemtogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-15d,
+ DensityUnit.FemtogramPerLiter => (baseUnitValue * 1) / 1e-15d,
+ DensityUnit.FemtogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-15d,
+ DensityUnit.GramPerCubicCentimeter => baseUnitValue * 1e-3,
+ DensityUnit.GramPerCubicFoot => baseUnitValue * 0.028316846592 / 0.001,
+ DensityUnit.GramPerCubicInch => baseUnitValue * 1.6387064e-5 / 0.001,
+ DensityUnit.GramPerCubicMeter => baseUnitValue * 1e3,
+ DensityUnit.GramPerCubicMillimeter => baseUnitValue * 1e-6,
+ DensityUnit.GramPerDeciliter => baseUnitValue * 1e-1,
+ DensityUnit.GramPerLiter => baseUnitValue * 1,
+ DensityUnit.GramPerMilliliter => baseUnitValue * 1e-3,
+ DensityUnit.KilogramPerCubicCentimeter => (baseUnitValue * 1e-3) / 1e3d,
+ DensityUnit.KilogramPerCubicMeter => (baseUnitValue * 1e3) / 1e3d,
+ DensityUnit.KilogramPerCubicMillimeter => (baseUnitValue * 1e-6) / 1e3d,
+ DensityUnit.KilogramPerLiter => baseUnitValue / 1e3,
+ DensityUnit.KilopoundPerCubicFoot => (baseUnitValue * 0.028316846592 / 0.45359237) / 1e3d,
+ DensityUnit.KilopoundPerCubicInch => (baseUnitValue * 1.6387064e-5 / 0.45359237) / 1e3d,
+ DensityUnit.KilopoundPerCubicYard => (baseUnitValue * 0.764554857984 / 0.45359237) / 1e3d,
+ DensityUnit.MicrogramPerCubicMeter => (baseUnitValue * 1e3) / 1e-6d,
+ DensityUnit.MicrogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-6d,
+ DensityUnit.MicrogramPerLiter => (baseUnitValue * 1) / 1e-6d,
+ DensityUnit.MicrogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-6d,
+ DensityUnit.MilligramPerCubicMeter => (baseUnitValue * 1e3) / 1e-3d,
+ DensityUnit.MilligramPerDeciliter => (baseUnitValue * 1e-1) / 1e-3d,
+ DensityUnit.MilligramPerLiter => (baseUnitValue * 1) / 1e-3d,
+ DensityUnit.MilligramPerMilliliter => (baseUnitValue * 1e-3) / 1e-3d,
+ DensityUnit.NanogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-9d,
+ DensityUnit.NanogramPerLiter => (baseUnitValue * 1) / 1e-9d,
+ DensityUnit.NanogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-9d,
+ DensityUnit.PicogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-12d,
+ DensityUnit.PicogramPerLiter => (baseUnitValue * 1) / 1e-12d,
+ DensityUnit.PicogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-12d,
+ DensityUnit.PoundPerCubicCentimeter => baseUnitValue / 0.45359237e6,
+ DensityUnit.PoundPerCubicFoot => baseUnitValue * 0.028316846592 / 0.45359237,
+ DensityUnit.PoundPerCubicInch => baseUnitValue * 1.6387064e-5 / 0.45359237,
+ DensityUnit.PoundPerCubicMeter => baseUnitValue / 0.45359237,
+ DensityUnit.PoundPerCubicMillimeter => baseUnitValue / 0.45359237e9,
+ DensityUnit.PoundPerCubicYard => baseUnitValue * 0.764554857984 / 0.45359237,
+ DensityUnit.PoundPerImperialGallon => baseUnitValue * 0.00454609 / 0.45359237,
+ DensityUnit.PoundPerUSGallon => baseUnitValue * 0.003785411784 / 0.45359237,
+ DensityUnit.SlugPerCubicCentimeter => baseUnitValue * 0.3048 / (0.45359237e6 * 9.80665),
+ DensityUnit.SlugPerCubicFoot => baseUnitValue * (0.3048 * 0.028316846592) / (0.45359237 * 9.80665),
+ DensityUnit.SlugPerCubicInch => baseUnitValue * (0.3048 * 1.6387064e-5) / (0.45359237 * 9.80665),
+ DensityUnit.SlugPerCubicMeter => baseUnitValue * 0.3048 / (0.45359237 * 9.80665),
+ DensityUnit.SlugPerCubicMillimeter => baseUnitValue * 0.3048 / (0.45359237e9 * 9.80665),
+ DensityUnit.TonnePerCubicCentimeter => baseUnitValue * 1e-9,
+ DensityUnit.TonnePerCubicFoot => baseUnitValue * 0.028316846592 / 1000,
+ DensityUnit.TonnePerCubicInch => baseUnitValue * 1.6387064e-5 / 1000,
+ DensityUnit.TonnePerCubicMeter => baseUnitValue * 0.001,
+ DensityUnit.TonnePerCubicMillimeter => baseUnitValue * 1e-12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/DoseAreaProduct.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/DoseAreaProduct.g.cs
index 60ad5a2b80..35c3ef0b8a 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/DoseAreaProduct.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/DoseAreaProduct.g.cs
@@ -348,101 +348,101 @@ public static DoseAreaProduct From(double value, DoseAreaProductUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(DoseAreaProductUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this DoseAreaProduct to another DoseAreaProduct with the unit representation .
- ///
- /// A DoseAreaProduct with the specified unit.
- public DoseAreaProduct ToUnit(DoseAreaProductUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new DoseAreaProduct(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- DoseAreaProductUnit.CentigraySquareCentimeter => (_value / 10000) * 1e-2d,
- DoseAreaProductUnit.CentigraySquareDecimeter => (_value / 100) * 1e-2d,
- DoseAreaProductUnit.CentigraySquareMeter => (_value) * 1e-2d,
- DoseAreaProductUnit.CentigraySquareMicrometer => (_value / 1000000000000) * 1e-2d,
- DoseAreaProductUnit.CentigraySquareMillimeter => (_value / 1000000) * 1e-2d,
- DoseAreaProductUnit.DecigraySquareCentimeter => (_value / 10000) * 1e-1d,
- DoseAreaProductUnit.DecigraySquareDecimeter => (_value / 100) * 1e-1d,
- DoseAreaProductUnit.DecigraySquareMeter => (_value) * 1e-1d,
- DoseAreaProductUnit.DecigraySquareMicrometer => (_value / 1000000000000) * 1e-1d,
- DoseAreaProductUnit.DecigraySquareMillimeter => (_value / 1000000) * 1e-1d,
- DoseAreaProductUnit.GraySquareCentimeter => _value / 10000,
- DoseAreaProductUnit.GraySquareDecimeter => _value / 100,
- DoseAreaProductUnit.GraySquareMeter => _value,
- DoseAreaProductUnit.GraySquareMicrometer => _value / 1000000000000,
- DoseAreaProductUnit.GraySquareMillimeter => _value / 1000000,
- DoseAreaProductUnit.MicrograySquareCentimeter => (_value / 10000) * 1e-6d,
- DoseAreaProductUnit.MicrograySquareDecimeter => (_value / 100) * 1e-6d,
- DoseAreaProductUnit.MicrograySquareMeter => (_value) * 1e-6d,
- DoseAreaProductUnit.MicrograySquareMicrometer => (_value / 1000000000000) * 1e-6d,
- DoseAreaProductUnit.MicrograySquareMillimeter => (_value / 1000000) * 1e-6d,
- DoseAreaProductUnit.MilligraySquareCentimeter => (_value / 10000) * 1e-3d,
- DoseAreaProductUnit.MilligraySquareDecimeter => (_value / 100) * 1e-3d,
- DoseAreaProductUnit.MilligraySquareMeter => (_value) * 1e-3d,
- DoseAreaProductUnit.MilligraySquareMicrometer => (_value / 1000000000000) * 1e-3d,
- DoseAreaProductUnit.MilligraySquareMillimeter => (_value / 1000000) * 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(DoseAreaProductUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- DoseAreaProductUnit.CentigraySquareCentimeter => (baseUnitValue * 10000) / 1e-2d,
- DoseAreaProductUnit.CentigraySquareDecimeter => (baseUnitValue * 100) / 1e-2d,
- DoseAreaProductUnit.CentigraySquareMeter => (baseUnitValue) / 1e-2d,
- DoseAreaProductUnit.CentigraySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-2d,
- DoseAreaProductUnit.CentigraySquareMillimeter => (baseUnitValue * 1000000) / 1e-2d,
- DoseAreaProductUnit.DecigraySquareCentimeter => (baseUnitValue * 10000) / 1e-1d,
- DoseAreaProductUnit.DecigraySquareDecimeter => (baseUnitValue * 100) / 1e-1d,
- DoseAreaProductUnit.DecigraySquareMeter => (baseUnitValue) / 1e-1d,
- DoseAreaProductUnit.DecigraySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-1d,
- DoseAreaProductUnit.DecigraySquareMillimeter => (baseUnitValue * 1000000) / 1e-1d,
- DoseAreaProductUnit.GraySquareCentimeter => baseUnitValue * 10000,
- DoseAreaProductUnit.GraySquareDecimeter => baseUnitValue * 100,
- DoseAreaProductUnit.GraySquareMeter => baseUnitValue,
- DoseAreaProductUnit.GraySquareMicrometer => baseUnitValue * 1000000000000,
- DoseAreaProductUnit.GraySquareMillimeter => baseUnitValue * 1000000,
- DoseAreaProductUnit.MicrograySquareCentimeter => (baseUnitValue * 10000) / 1e-6d,
- DoseAreaProductUnit.MicrograySquareDecimeter => (baseUnitValue * 100) / 1e-6d,
- DoseAreaProductUnit.MicrograySquareMeter => (baseUnitValue) / 1e-6d,
- DoseAreaProductUnit.MicrograySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-6d,
- DoseAreaProductUnit.MicrograySquareMillimeter => (baseUnitValue * 1000000) / 1e-6d,
- DoseAreaProductUnit.MilligraySquareCentimeter => (baseUnitValue * 10000) / 1e-3d,
- DoseAreaProductUnit.MilligraySquareDecimeter => (baseUnitValue * 100) / 1e-3d,
- DoseAreaProductUnit.MilligraySquareMeter => (baseUnitValue) / 1e-3d,
- DoseAreaProductUnit.MilligraySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-3d,
- DoseAreaProductUnit.MilligraySquareMillimeter => (baseUnitValue * 1000000) / 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(DoseAreaProductUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this DoseAreaProduct to another DoseAreaProduct with the unit representation .
+ ///
+ /// A DoseAreaProduct with the specified unit.
+ public DoseAreaProduct ToUnit(DoseAreaProductUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new DoseAreaProduct(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ DoseAreaProductUnit.CentigraySquareCentimeter => (_value / 10000) * 1e-2d,
+ DoseAreaProductUnit.CentigraySquareDecimeter => (_value / 100) * 1e-2d,
+ DoseAreaProductUnit.CentigraySquareMeter => (_value) * 1e-2d,
+ DoseAreaProductUnit.CentigraySquareMicrometer => (_value / 1000000000000) * 1e-2d,
+ DoseAreaProductUnit.CentigraySquareMillimeter => (_value / 1000000) * 1e-2d,
+ DoseAreaProductUnit.DecigraySquareCentimeter => (_value / 10000) * 1e-1d,
+ DoseAreaProductUnit.DecigraySquareDecimeter => (_value / 100) * 1e-1d,
+ DoseAreaProductUnit.DecigraySquareMeter => (_value) * 1e-1d,
+ DoseAreaProductUnit.DecigraySquareMicrometer => (_value / 1000000000000) * 1e-1d,
+ DoseAreaProductUnit.DecigraySquareMillimeter => (_value / 1000000) * 1e-1d,
+ DoseAreaProductUnit.GraySquareCentimeter => _value / 10000,
+ DoseAreaProductUnit.GraySquareDecimeter => _value / 100,
+ DoseAreaProductUnit.GraySquareMeter => _value,
+ DoseAreaProductUnit.GraySquareMicrometer => _value / 1000000000000,
+ DoseAreaProductUnit.GraySquareMillimeter => _value / 1000000,
+ DoseAreaProductUnit.MicrograySquareCentimeter => (_value / 10000) * 1e-6d,
+ DoseAreaProductUnit.MicrograySquareDecimeter => (_value / 100) * 1e-6d,
+ DoseAreaProductUnit.MicrograySquareMeter => (_value) * 1e-6d,
+ DoseAreaProductUnit.MicrograySquareMicrometer => (_value / 1000000000000) * 1e-6d,
+ DoseAreaProductUnit.MicrograySquareMillimeter => (_value / 1000000) * 1e-6d,
+ DoseAreaProductUnit.MilligraySquareCentimeter => (_value / 10000) * 1e-3d,
+ DoseAreaProductUnit.MilligraySquareDecimeter => (_value / 100) * 1e-3d,
+ DoseAreaProductUnit.MilligraySquareMeter => (_value) * 1e-3d,
+ DoseAreaProductUnit.MilligraySquareMicrometer => (_value / 1000000000000) * 1e-3d,
+ DoseAreaProductUnit.MilligraySquareMillimeter => (_value / 1000000) * 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(DoseAreaProductUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ DoseAreaProductUnit.CentigraySquareCentimeter => (baseUnitValue * 10000) / 1e-2d,
+ DoseAreaProductUnit.CentigraySquareDecimeter => (baseUnitValue * 100) / 1e-2d,
+ DoseAreaProductUnit.CentigraySquareMeter => (baseUnitValue) / 1e-2d,
+ DoseAreaProductUnit.CentigraySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-2d,
+ DoseAreaProductUnit.CentigraySquareMillimeter => (baseUnitValue * 1000000) / 1e-2d,
+ DoseAreaProductUnit.DecigraySquareCentimeter => (baseUnitValue * 10000) / 1e-1d,
+ DoseAreaProductUnit.DecigraySquareDecimeter => (baseUnitValue * 100) / 1e-1d,
+ DoseAreaProductUnit.DecigraySquareMeter => (baseUnitValue) / 1e-1d,
+ DoseAreaProductUnit.DecigraySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-1d,
+ DoseAreaProductUnit.DecigraySquareMillimeter => (baseUnitValue * 1000000) / 1e-1d,
+ DoseAreaProductUnit.GraySquareCentimeter => baseUnitValue * 10000,
+ DoseAreaProductUnit.GraySquareDecimeter => baseUnitValue * 100,
+ DoseAreaProductUnit.GraySquareMeter => baseUnitValue,
+ DoseAreaProductUnit.GraySquareMicrometer => baseUnitValue * 1000000000000,
+ DoseAreaProductUnit.GraySquareMillimeter => baseUnitValue * 1000000,
+ DoseAreaProductUnit.MicrograySquareCentimeter => (baseUnitValue * 10000) / 1e-6d,
+ DoseAreaProductUnit.MicrograySquareDecimeter => (baseUnitValue * 100) / 1e-6d,
+ DoseAreaProductUnit.MicrograySquareMeter => (baseUnitValue) / 1e-6d,
+ DoseAreaProductUnit.MicrograySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-6d,
+ DoseAreaProductUnit.MicrograySquareMillimeter => (baseUnitValue * 1000000) / 1e-6d,
+ DoseAreaProductUnit.MilligraySquareCentimeter => (baseUnitValue * 10000) / 1e-3d,
+ DoseAreaProductUnit.MilligraySquareDecimeter => (baseUnitValue * 100) / 1e-3d,
+ DoseAreaProductUnit.MilligraySquareMeter => (baseUnitValue) / 1e-3d,
+ DoseAreaProductUnit.MilligraySquareMicrometer => (baseUnitValue * 1000000000000) / 1e-3d,
+ DoseAreaProductUnit.MilligraySquareMillimeter => (baseUnitValue * 1000000) / 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Duration.g.cs
index c67c4749af..982dcfc35a 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Duration.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Duration.g.cs
@@ -225,77 +225,77 @@ public static Duration From(double value, DurationUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(DurationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Duration to another Duration with the unit representation .
- ///
- /// A Duration with the specified unit.
- public Duration ToUnit(DurationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Duration(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- DurationUnit.Day => _value * 24 * 3600,
- DurationUnit.Hour => _value * 3600,
- DurationUnit.JulianYear => _value * 365.25 * 24 * 3600,
- DurationUnit.Microsecond => (_value) * 1e-6d,
- DurationUnit.Millisecond => (_value) * 1e-3d,
- DurationUnit.Minute => _value * 60,
- DurationUnit.Month30 => _value * 30 * 24 * 3600,
- DurationUnit.Nanosecond => (_value) * 1e-9d,
- DurationUnit.Picosecond => (_value) * 1e-12d,
- DurationUnit.Second => _value,
- DurationUnit.Sol => _value * 88775.244,
- DurationUnit.Week => _value * 7 * 24 * 3600,
- DurationUnit.Year365 => _value * 365 * 24 * 3600,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(DurationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- DurationUnit.Day => baseUnitValue / (24 * 3600),
- DurationUnit.Hour => baseUnitValue / 3600,
- DurationUnit.JulianYear => baseUnitValue / (365.25 * 24 * 3600),
- DurationUnit.Microsecond => (baseUnitValue) / 1e-6d,
- DurationUnit.Millisecond => (baseUnitValue) / 1e-3d,
- DurationUnit.Minute => baseUnitValue / 60,
- DurationUnit.Month30 => baseUnitValue / (30 * 24 * 3600),
- DurationUnit.Nanosecond => (baseUnitValue) / 1e-9d,
- DurationUnit.Picosecond => (baseUnitValue) / 1e-12d,
- DurationUnit.Second => baseUnitValue,
- DurationUnit.Sol => baseUnitValue / 88775.244,
- DurationUnit.Week => baseUnitValue / (7 * 24 * 3600),
- DurationUnit.Year365 => baseUnitValue / (365 * 24 * 3600),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(DurationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Duration to another Duration with the unit representation .
+ ///
+ /// A Duration with the specified unit.
+ public Duration ToUnit(DurationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Duration(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ DurationUnit.Day => _value * 24 * 3600,
+ DurationUnit.Hour => _value * 3600,
+ DurationUnit.JulianYear => _value * 365.25 * 24 * 3600,
+ DurationUnit.Microsecond => (_value) * 1e-6d,
+ DurationUnit.Millisecond => (_value) * 1e-3d,
+ DurationUnit.Minute => _value * 60,
+ DurationUnit.Month30 => _value * 30 * 24 * 3600,
+ DurationUnit.Nanosecond => (_value) * 1e-9d,
+ DurationUnit.Picosecond => (_value) * 1e-12d,
+ DurationUnit.Second => _value,
+ DurationUnit.Sol => _value * 88775.244,
+ DurationUnit.Week => _value * 7 * 24 * 3600,
+ DurationUnit.Year365 => _value * 365 * 24 * 3600,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(DurationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ DurationUnit.Day => baseUnitValue / (24 * 3600),
+ DurationUnit.Hour => baseUnitValue / 3600,
+ DurationUnit.JulianYear => baseUnitValue / (365.25 * 24 * 3600),
+ DurationUnit.Microsecond => (baseUnitValue) / 1e-6d,
+ DurationUnit.Millisecond => (baseUnitValue) / 1e-3d,
+ DurationUnit.Minute => baseUnitValue / 60,
+ DurationUnit.Month30 => baseUnitValue / (30 * 24 * 3600),
+ DurationUnit.Nanosecond => (baseUnitValue) / 1e-9d,
+ DurationUnit.Picosecond => (baseUnitValue) / 1e-12d,
+ DurationUnit.Second => baseUnitValue,
+ DurationUnit.Sol => baseUnitValue / 88775.244,
+ DurationUnit.Week => baseUnitValue / (7 * 24 * 3600),
+ DurationUnit.Year365 => baseUnitValue / (365 * 24 * 3600),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/DynamicViscosity.g.cs
index 20f3f8abda..24b9f63b1e 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/DynamicViscosity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/DynamicViscosity.g.cs
@@ -198,71 +198,71 @@ public static DynamicViscosity From(double value, DynamicViscosityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(DynamicViscosityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this DynamicViscosity to another DynamicViscosity with the unit representation .
- ///
- /// A DynamicViscosity with the specified unit.
- public DynamicViscosity ToUnit(DynamicViscosityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new DynamicViscosity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- DynamicViscosityUnit.Centipoise => (_value / 10) * 1e-2d,
- DynamicViscosityUnit.MicropascalSecond => (_value) * 1e-6d,
- DynamicViscosityUnit.MillipascalSecond => (_value) * 1e-3d,
- DynamicViscosityUnit.NewtonSecondPerMeterSquared => _value,
- DynamicViscosityUnit.PascalSecond => _value,
- DynamicViscosityUnit.Poise => _value / 10,
- DynamicViscosityUnit.PoundForceSecondPerSquareFoot => _value * 4.4482216152605 / 9.290304e-2,
- DynamicViscosityUnit.PoundForceSecondPerSquareInch => _value * 4.4482216152605 / 0.00064516,
- DynamicViscosityUnit.PoundPerFootSecond => _value * 0.45359237 / 0.3048,
- DynamicViscosityUnit.Reyn => _value * 4.4482216152605 / 0.00064516,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(DynamicViscosityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- DynamicViscosityUnit.Centipoise => (baseUnitValue * 10) / 1e-2d,
- DynamicViscosityUnit.MicropascalSecond => (baseUnitValue) / 1e-6d,
- DynamicViscosityUnit.MillipascalSecond => (baseUnitValue) / 1e-3d,
- DynamicViscosityUnit.NewtonSecondPerMeterSquared => baseUnitValue,
- DynamicViscosityUnit.PascalSecond => baseUnitValue,
- DynamicViscosityUnit.Poise => baseUnitValue * 10,
- DynamicViscosityUnit.PoundForceSecondPerSquareFoot => baseUnitValue * 9.290304e-2 / 4.4482216152605,
- DynamicViscosityUnit.PoundForceSecondPerSquareInch => baseUnitValue * 0.00064516 / 4.4482216152605,
- DynamicViscosityUnit.PoundPerFootSecond => baseUnitValue * 0.3048 / 0.45359237,
- DynamicViscosityUnit.Reyn => baseUnitValue * 0.00064516 / 4.4482216152605,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(DynamicViscosityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this DynamicViscosity to another DynamicViscosity with the unit representation .
+ ///
+ /// A DynamicViscosity with the specified unit.
+ public DynamicViscosity ToUnit(DynamicViscosityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new DynamicViscosity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ DynamicViscosityUnit.Centipoise => (_value / 10) * 1e-2d,
+ DynamicViscosityUnit.MicropascalSecond => (_value) * 1e-6d,
+ DynamicViscosityUnit.MillipascalSecond => (_value) * 1e-3d,
+ DynamicViscosityUnit.NewtonSecondPerMeterSquared => _value,
+ DynamicViscosityUnit.PascalSecond => _value,
+ DynamicViscosityUnit.Poise => _value / 10,
+ DynamicViscosityUnit.PoundForceSecondPerSquareFoot => _value * 4.4482216152605 / 9.290304e-2,
+ DynamicViscosityUnit.PoundForceSecondPerSquareInch => _value * 4.4482216152605 / 0.00064516,
+ DynamicViscosityUnit.PoundPerFootSecond => _value * 0.45359237 / 0.3048,
+ DynamicViscosityUnit.Reyn => _value * 4.4482216152605 / 0.00064516,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(DynamicViscosityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ DynamicViscosityUnit.Centipoise => (baseUnitValue * 10) / 1e-2d,
+ DynamicViscosityUnit.MicropascalSecond => (baseUnitValue) / 1e-6d,
+ DynamicViscosityUnit.MillipascalSecond => (baseUnitValue) / 1e-3d,
+ DynamicViscosityUnit.NewtonSecondPerMeterSquared => baseUnitValue,
+ DynamicViscosityUnit.PascalSecond => baseUnitValue,
+ DynamicViscosityUnit.Poise => baseUnitValue * 10,
+ DynamicViscosityUnit.PoundForceSecondPerSquareFoot => baseUnitValue * 9.290304e-2 / 4.4482216152605,
+ DynamicViscosityUnit.PoundForceSecondPerSquareInch => baseUnitValue * 0.00064516 / 4.4482216152605,
+ DynamicViscosityUnit.PoundPerFootSecond => baseUnitValue * 0.3048 / 0.45359237,
+ DynamicViscosityUnit.Reyn => baseUnitValue * 0.00064516 / 4.4482216152605,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricAdmittance.g.cs
index b943463a95..fb10eeb7cb 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricAdmittance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricAdmittance.g.cs
@@ -259,83 +259,83 @@ public static ElectricAdmittance From(double value, ElectricAdmittanceUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricAdmittanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricAdmittance to another ElectricAdmittance with the unit representation .
- ///
- /// A ElectricAdmittance with the specified unit.
- public ElectricAdmittance ToUnit(ElectricAdmittanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricAdmittance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricAdmittanceUnit.Gigamho => (_value) * 1e9d,
- ElectricAdmittanceUnit.Gigasiemens => (_value) * 1e9d,
- ElectricAdmittanceUnit.Kilomho => (_value) * 1e3d,
- ElectricAdmittanceUnit.Kilosiemens => (_value) * 1e3d,
- ElectricAdmittanceUnit.Megamho => (_value) * 1e6d,
- ElectricAdmittanceUnit.Megasiemens => (_value) * 1e6d,
- ElectricAdmittanceUnit.Mho => _value,
- ElectricAdmittanceUnit.Micromho => (_value) * 1e-6d,
- ElectricAdmittanceUnit.Microsiemens => (_value) * 1e-6d,
- ElectricAdmittanceUnit.Millimho => (_value) * 1e-3d,
- ElectricAdmittanceUnit.Millisiemens => (_value) * 1e-3d,
- ElectricAdmittanceUnit.Nanomho => (_value) * 1e-9d,
- ElectricAdmittanceUnit.Nanosiemens => (_value) * 1e-9d,
- ElectricAdmittanceUnit.Siemens => _value,
- ElectricAdmittanceUnit.Teramho => (_value) * 1e12d,
- ElectricAdmittanceUnit.Terasiemens => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricAdmittanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricAdmittanceUnit.Gigamho => (baseUnitValue) / 1e9d,
- ElectricAdmittanceUnit.Gigasiemens => (baseUnitValue) / 1e9d,
- ElectricAdmittanceUnit.Kilomho => (baseUnitValue) / 1e3d,
- ElectricAdmittanceUnit.Kilosiemens => (baseUnitValue) / 1e3d,
- ElectricAdmittanceUnit.Megamho => (baseUnitValue) / 1e6d,
- ElectricAdmittanceUnit.Megasiemens => (baseUnitValue) / 1e6d,
- ElectricAdmittanceUnit.Mho => baseUnitValue,
- ElectricAdmittanceUnit.Micromho => (baseUnitValue) / 1e-6d,
- ElectricAdmittanceUnit.Microsiemens => (baseUnitValue) / 1e-6d,
- ElectricAdmittanceUnit.Millimho => (baseUnitValue) / 1e-3d,
- ElectricAdmittanceUnit.Millisiemens => (baseUnitValue) / 1e-3d,
- ElectricAdmittanceUnit.Nanomho => (baseUnitValue) / 1e-9d,
- ElectricAdmittanceUnit.Nanosiemens => (baseUnitValue) / 1e-9d,
- ElectricAdmittanceUnit.Siemens => baseUnitValue,
- ElectricAdmittanceUnit.Teramho => (baseUnitValue) / 1e12d,
- ElectricAdmittanceUnit.Terasiemens => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricAdmittanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricAdmittance to another ElectricAdmittance with the unit representation .
+ ///
+ /// A ElectricAdmittance with the specified unit.
+ public ElectricAdmittance ToUnit(ElectricAdmittanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricAdmittance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricAdmittanceUnit.Gigamho => (_value) * 1e9d,
+ ElectricAdmittanceUnit.Gigasiemens => (_value) * 1e9d,
+ ElectricAdmittanceUnit.Kilomho => (_value) * 1e3d,
+ ElectricAdmittanceUnit.Kilosiemens => (_value) * 1e3d,
+ ElectricAdmittanceUnit.Megamho => (_value) * 1e6d,
+ ElectricAdmittanceUnit.Megasiemens => (_value) * 1e6d,
+ ElectricAdmittanceUnit.Mho => _value,
+ ElectricAdmittanceUnit.Micromho => (_value) * 1e-6d,
+ ElectricAdmittanceUnit.Microsiemens => (_value) * 1e-6d,
+ ElectricAdmittanceUnit.Millimho => (_value) * 1e-3d,
+ ElectricAdmittanceUnit.Millisiemens => (_value) * 1e-3d,
+ ElectricAdmittanceUnit.Nanomho => (_value) * 1e-9d,
+ ElectricAdmittanceUnit.Nanosiemens => (_value) * 1e-9d,
+ ElectricAdmittanceUnit.Siemens => _value,
+ ElectricAdmittanceUnit.Teramho => (_value) * 1e12d,
+ ElectricAdmittanceUnit.Terasiemens => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricAdmittanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricAdmittanceUnit.Gigamho => (baseUnitValue) / 1e9d,
+ ElectricAdmittanceUnit.Gigasiemens => (baseUnitValue) / 1e9d,
+ ElectricAdmittanceUnit.Kilomho => (baseUnitValue) / 1e3d,
+ ElectricAdmittanceUnit.Kilosiemens => (baseUnitValue) / 1e3d,
+ ElectricAdmittanceUnit.Megamho => (baseUnitValue) / 1e6d,
+ ElectricAdmittanceUnit.Megasiemens => (baseUnitValue) / 1e6d,
+ ElectricAdmittanceUnit.Mho => baseUnitValue,
+ ElectricAdmittanceUnit.Micromho => (baseUnitValue) / 1e-6d,
+ ElectricAdmittanceUnit.Microsiemens => (baseUnitValue) / 1e-6d,
+ ElectricAdmittanceUnit.Millimho => (baseUnitValue) / 1e-3d,
+ ElectricAdmittanceUnit.Millisiemens => (baseUnitValue) / 1e-3d,
+ ElectricAdmittanceUnit.Nanomho => (baseUnitValue) / 1e-9d,
+ ElectricAdmittanceUnit.Nanosiemens => (baseUnitValue) / 1e-9d,
+ ElectricAdmittanceUnit.Siemens => baseUnitValue,
+ ElectricAdmittanceUnit.Teramho => (baseUnitValue) / 1e12d,
+ ElectricAdmittanceUnit.Terasiemens => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs
index d6aaee81c4..f0d1dad32b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentEnergy.g.cs
@@ -125,57 +125,57 @@ public static ElectricApparentEnergy From(double value, ElectricApparentEnergyUn
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricApparentEnergyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricApparentEnergy to another ElectricApparentEnergy with the unit representation .
- ///
- /// A ElectricApparentEnergy with the specified unit.
- public ElectricApparentEnergy ToUnit(ElectricApparentEnergyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricApparentEnergy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricApparentEnergyUnit.KilovoltampereHour => (_value) * 1e3d,
- ElectricApparentEnergyUnit.MegavoltampereHour => (_value) * 1e6d,
- ElectricApparentEnergyUnit.VoltampereHour => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricApparentEnergyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricApparentEnergyUnit.KilovoltampereHour => (baseUnitValue) / 1e3d,
- ElectricApparentEnergyUnit.MegavoltampereHour => (baseUnitValue) / 1e6d,
- ElectricApparentEnergyUnit.VoltampereHour => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricApparentEnergyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricApparentEnergy to another ElectricApparentEnergy with the unit representation .
+ ///
+ /// A ElectricApparentEnergy with the specified unit.
+ public ElectricApparentEnergy ToUnit(ElectricApparentEnergyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricApparentEnergy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricApparentEnergyUnit.KilovoltampereHour => (_value) * 1e3d,
+ ElectricApparentEnergyUnit.MegavoltampereHour => (_value) * 1e6d,
+ ElectricApparentEnergyUnit.VoltampereHour => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricApparentEnergyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricApparentEnergyUnit.KilovoltampereHour => (baseUnitValue) / 1e3d,
+ ElectricApparentEnergyUnit.MegavoltampereHour => (baseUnitValue) / 1e6d,
+ ElectricApparentEnergyUnit.VoltampereHour => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentPower.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentPower.g.cs
index 664e6e2d5f..a56c01d2e2 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentPower.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricApparentPower.g.cs
@@ -158,63 +158,63 @@ public static ElectricApparentPower From(double value, ElectricApparentPowerUnit
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricApparentPowerUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricApparentPower to another ElectricApparentPower with the unit representation .
- ///
- /// A ElectricApparentPower with the specified unit.
- public ElectricApparentPower ToUnit(ElectricApparentPowerUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricApparentPower(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricApparentPowerUnit.Gigavoltampere => (_value) * 1e9d,
- ElectricApparentPowerUnit.Kilovoltampere => (_value) * 1e3d,
- ElectricApparentPowerUnit.Megavoltampere => (_value) * 1e6d,
- ElectricApparentPowerUnit.Microvoltampere => (_value) * 1e-6d,
- ElectricApparentPowerUnit.Millivoltampere => (_value) * 1e-3d,
- ElectricApparentPowerUnit.Voltampere => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricApparentPowerUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricApparentPowerUnit.Gigavoltampere => (baseUnitValue) / 1e9d,
- ElectricApparentPowerUnit.Kilovoltampere => (baseUnitValue) / 1e3d,
- ElectricApparentPowerUnit.Megavoltampere => (baseUnitValue) / 1e6d,
- ElectricApparentPowerUnit.Microvoltampere => (baseUnitValue) / 1e-6d,
- ElectricApparentPowerUnit.Millivoltampere => (baseUnitValue) / 1e-3d,
- ElectricApparentPowerUnit.Voltampere => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricApparentPowerUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricApparentPower to another ElectricApparentPower with the unit representation .
+ ///
+ /// A ElectricApparentPower with the specified unit.
+ public ElectricApparentPower ToUnit(ElectricApparentPowerUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricApparentPower(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricApparentPowerUnit.Gigavoltampere => (_value) * 1e9d,
+ ElectricApparentPowerUnit.Kilovoltampere => (_value) * 1e3d,
+ ElectricApparentPowerUnit.Megavoltampere => (_value) * 1e6d,
+ ElectricApparentPowerUnit.Microvoltampere => (_value) * 1e-6d,
+ ElectricApparentPowerUnit.Millivoltampere => (_value) * 1e-3d,
+ ElectricApparentPowerUnit.Voltampere => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricApparentPowerUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricApparentPowerUnit.Gigavoltampere => (baseUnitValue) / 1e9d,
+ ElectricApparentPowerUnit.Kilovoltampere => (baseUnitValue) / 1e3d,
+ ElectricApparentPowerUnit.Megavoltampere => (baseUnitValue) / 1e6d,
+ ElectricApparentPowerUnit.Microvoltampere => (baseUnitValue) / 1e-6d,
+ ElectricApparentPowerUnit.Millivoltampere => (baseUnitValue) / 1e-3d,
+ ElectricApparentPowerUnit.Voltampere => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCapacitance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCapacitance.g.cs
index 0baa8898bf..279a1085e4 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCapacitance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCapacitance.g.cs
@@ -168,65 +168,65 @@ public static ElectricCapacitance From(double value, ElectricCapacitanceUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricCapacitanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricCapacitance to another ElectricCapacitance with the unit representation .
- ///
- /// A ElectricCapacitance with the specified unit.
- public ElectricCapacitance ToUnit(ElectricCapacitanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricCapacitance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricCapacitanceUnit.Farad => _value,
- ElectricCapacitanceUnit.Kilofarad => (_value) * 1e3d,
- ElectricCapacitanceUnit.Megafarad => (_value) * 1e6d,
- ElectricCapacitanceUnit.Microfarad => (_value) * 1e-6d,
- ElectricCapacitanceUnit.Millifarad => (_value) * 1e-3d,
- ElectricCapacitanceUnit.Nanofarad => (_value) * 1e-9d,
- ElectricCapacitanceUnit.Picofarad => (_value) * 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricCapacitanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricCapacitanceUnit.Farad => baseUnitValue,
- ElectricCapacitanceUnit.Kilofarad => (baseUnitValue) / 1e3d,
- ElectricCapacitanceUnit.Megafarad => (baseUnitValue) / 1e6d,
- ElectricCapacitanceUnit.Microfarad => (baseUnitValue) / 1e-6d,
- ElectricCapacitanceUnit.Millifarad => (baseUnitValue) / 1e-3d,
- ElectricCapacitanceUnit.Nanofarad => (baseUnitValue) / 1e-9d,
- ElectricCapacitanceUnit.Picofarad => (baseUnitValue) / 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricCapacitanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricCapacitance to another ElectricCapacitance with the unit representation .
+ ///
+ /// A ElectricCapacitance with the specified unit.
+ public ElectricCapacitance ToUnit(ElectricCapacitanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricCapacitance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricCapacitanceUnit.Farad => _value,
+ ElectricCapacitanceUnit.Kilofarad => (_value) * 1e3d,
+ ElectricCapacitanceUnit.Megafarad => (_value) * 1e6d,
+ ElectricCapacitanceUnit.Microfarad => (_value) * 1e-6d,
+ ElectricCapacitanceUnit.Millifarad => (_value) * 1e-3d,
+ ElectricCapacitanceUnit.Nanofarad => (_value) * 1e-9d,
+ ElectricCapacitanceUnit.Picofarad => (_value) * 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricCapacitanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricCapacitanceUnit.Farad => baseUnitValue,
+ ElectricCapacitanceUnit.Kilofarad => (baseUnitValue) / 1e3d,
+ ElectricCapacitanceUnit.Megafarad => (baseUnitValue) / 1e6d,
+ ElectricCapacitanceUnit.Microfarad => (baseUnitValue) / 1e-6d,
+ ElectricCapacitanceUnit.Millifarad => (baseUnitValue) / 1e-3d,
+ ElectricCapacitanceUnit.Nanofarad => (baseUnitValue) / 1e-9d,
+ ElectricCapacitanceUnit.Picofarad => (baseUnitValue) / 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCharge.g.cs
index 0945446f39..3fd9dd7c63 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCharge.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCharge.g.cs
@@ -208,73 +208,73 @@ public static ElectricCharge From(double value, ElectricChargeUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricChargeUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricCharge to another ElectricCharge with the unit representation .
- ///
- /// A ElectricCharge with the specified unit.
- public ElectricCharge ToUnit(ElectricChargeUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricCharge(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricChargeUnit.AmpereHour => _value * 3600,
- ElectricChargeUnit.Coulomb => _value,
- ElectricChargeUnit.KiloampereHour => (_value * 3600) * 1e3d,
- ElectricChargeUnit.Kilocoulomb => (_value) * 1e3d,
- ElectricChargeUnit.MegaampereHour => (_value * 3600) * 1e6d,
- ElectricChargeUnit.Megacoulomb => (_value) * 1e6d,
- ElectricChargeUnit.Microcoulomb => (_value) * 1e-6d,
- ElectricChargeUnit.MilliampereHour => (_value * 3600) * 1e-3d,
- ElectricChargeUnit.Millicoulomb => (_value) * 1e-3d,
- ElectricChargeUnit.Nanocoulomb => (_value) * 1e-9d,
- ElectricChargeUnit.Picocoulomb => (_value) * 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricChargeUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricChargeUnit.AmpereHour => baseUnitValue / 3600,
- ElectricChargeUnit.Coulomb => baseUnitValue,
- ElectricChargeUnit.KiloampereHour => (baseUnitValue / 3600) / 1e3d,
- ElectricChargeUnit.Kilocoulomb => (baseUnitValue) / 1e3d,
- ElectricChargeUnit.MegaampereHour => (baseUnitValue / 3600) / 1e6d,
- ElectricChargeUnit.Megacoulomb => (baseUnitValue) / 1e6d,
- ElectricChargeUnit.Microcoulomb => (baseUnitValue) / 1e-6d,
- ElectricChargeUnit.MilliampereHour => (baseUnitValue / 3600) / 1e-3d,
- ElectricChargeUnit.Millicoulomb => (baseUnitValue) / 1e-3d,
- ElectricChargeUnit.Nanocoulomb => (baseUnitValue) / 1e-9d,
- ElectricChargeUnit.Picocoulomb => (baseUnitValue) / 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricChargeUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricCharge to another ElectricCharge with the unit representation .
+ ///
+ /// A ElectricCharge with the specified unit.
+ public ElectricCharge ToUnit(ElectricChargeUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricCharge(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricChargeUnit.AmpereHour => _value * 3600,
+ ElectricChargeUnit.Coulomb => _value,
+ ElectricChargeUnit.KiloampereHour => (_value * 3600) * 1e3d,
+ ElectricChargeUnit.Kilocoulomb => (_value) * 1e3d,
+ ElectricChargeUnit.MegaampereHour => (_value * 3600) * 1e6d,
+ ElectricChargeUnit.Megacoulomb => (_value) * 1e6d,
+ ElectricChargeUnit.Microcoulomb => (_value) * 1e-6d,
+ ElectricChargeUnit.MilliampereHour => (_value * 3600) * 1e-3d,
+ ElectricChargeUnit.Millicoulomb => (_value) * 1e-3d,
+ ElectricChargeUnit.Nanocoulomb => (_value) * 1e-9d,
+ ElectricChargeUnit.Picocoulomb => (_value) * 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricChargeUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricChargeUnit.AmpereHour => baseUnitValue / 3600,
+ ElectricChargeUnit.Coulomb => baseUnitValue,
+ ElectricChargeUnit.KiloampereHour => (baseUnitValue / 3600) / 1e3d,
+ ElectricChargeUnit.Kilocoulomb => (baseUnitValue) / 1e3d,
+ ElectricChargeUnit.MegaampereHour => (baseUnitValue / 3600) / 1e6d,
+ ElectricChargeUnit.Megacoulomb => (baseUnitValue) / 1e6d,
+ ElectricChargeUnit.Microcoulomb => (baseUnitValue) / 1e-6d,
+ ElectricChargeUnit.MilliampereHour => (baseUnitValue / 3600) / 1e-3d,
+ ElectricChargeUnit.Millicoulomb => (baseUnitValue) / 1e-3d,
+ ElectricChargeUnit.Nanocoulomb => (baseUnitValue) / 1e-9d,
+ ElectricChargeUnit.Picocoulomb => (baseUnitValue) / 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricChargeDensity.g.cs
index d6756615c0..a1d387e175 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricChargeDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricChargeDensity.g.cs
@@ -108,53 +108,53 @@ public static ElectricChargeDensity From(double value, ElectricChargeDensityUnit
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricChargeDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricChargeDensity to another ElectricChargeDensity with the unit representation .
- ///
- /// A ElectricChargeDensity with the specified unit.
- public ElectricChargeDensity ToUnit(ElectricChargeDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricChargeDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricChargeDensityUnit.CoulombPerCubicMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricChargeDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricChargeDensityUnit.CoulombPerCubicMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricChargeDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricChargeDensity to another ElectricChargeDensity with the unit representation .
+ ///
+ /// A ElectricChargeDensity with the specified unit.
+ public ElectricChargeDensity ToUnit(ElectricChargeDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricChargeDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricChargeDensityUnit.CoulombPerCubicMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricChargeDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricChargeDensityUnit.CoulombPerCubicMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductance.g.cs
index ba5038103d..20e07aa319 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductance.g.cs
@@ -258,83 +258,83 @@ public static ElectricConductance From(double value, ElectricConductanceUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricConductanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricConductance to another ElectricConductance with the unit representation .
- ///
- /// A ElectricConductance with the specified unit.
- public ElectricConductance ToUnit(ElectricConductanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricConductance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricConductanceUnit.Gigamho => (_value) * 1e9d,
- ElectricConductanceUnit.Gigasiemens => (_value) * 1e9d,
- ElectricConductanceUnit.Kilomho => (_value) * 1e3d,
- ElectricConductanceUnit.Kilosiemens => (_value) * 1e3d,
- ElectricConductanceUnit.Megamho => (_value) * 1e6d,
- ElectricConductanceUnit.Megasiemens => (_value) * 1e6d,
- ElectricConductanceUnit.Mho => _value,
- ElectricConductanceUnit.Micromho => (_value) * 1e-6d,
- ElectricConductanceUnit.Microsiemens => (_value) * 1e-6d,
- ElectricConductanceUnit.Millimho => (_value) * 1e-3d,
- ElectricConductanceUnit.Millisiemens => (_value) * 1e-3d,
- ElectricConductanceUnit.Nanomho => (_value) * 1e-9d,
- ElectricConductanceUnit.Nanosiemens => (_value) * 1e-9d,
- ElectricConductanceUnit.Siemens => _value,
- ElectricConductanceUnit.Teramho => (_value) * 1e12d,
- ElectricConductanceUnit.Terasiemens => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricConductanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricConductanceUnit.Gigamho => (baseUnitValue) / 1e9d,
- ElectricConductanceUnit.Gigasiemens => (baseUnitValue) / 1e9d,
- ElectricConductanceUnit.Kilomho => (baseUnitValue) / 1e3d,
- ElectricConductanceUnit.Kilosiemens => (baseUnitValue) / 1e3d,
- ElectricConductanceUnit.Megamho => (baseUnitValue) / 1e6d,
- ElectricConductanceUnit.Megasiemens => (baseUnitValue) / 1e6d,
- ElectricConductanceUnit.Mho => baseUnitValue,
- ElectricConductanceUnit.Micromho => (baseUnitValue) / 1e-6d,
- ElectricConductanceUnit.Microsiemens => (baseUnitValue) / 1e-6d,
- ElectricConductanceUnit.Millimho => (baseUnitValue) / 1e-3d,
- ElectricConductanceUnit.Millisiemens => (baseUnitValue) / 1e-3d,
- ElectricConductanceUnit.Nanomho => (baseUnitValue) / 1e-9d,
- ElectricConductanceUnit.Nanosiemens => (baseUnitValue) / 1e-9d,
- ElectricConductanceUnit.Siemens => baseUnitValue,
- ElectricConductanceUnit.Teramho => (baseUnitValue) / 1e12d,
- ElectricConductanceUnit.Terasiemens => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricConductanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricConductance to another ElectricConductance with the unit representation .
+ ///
+ /// A ElectricConductance with the specified unit.
+ public ElectricConductance ToUnit(ElectricConductanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricConductance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricConductanceUnit.Gigamho => (_value) * 1e9d,
+ ElectricConductanceUnit.Gigasiemens => (_value) * 1e9d,
+ ElectricConductanceUnit.Kilomho => (_value) * 1e3d,
+ ElectricConductanceUnit.Kilosiemens => (_value) * 1e3d,
+ ElectricConductanceUnit.Megamho => (_value) * 1e6d,
+ ElectricConductanceUnit.Megasiemens => (_value) * 1e6d,
+ ElectricConductanceUnit.Mho => _value,
+ ElectricConductanceUnit.Micromho => (_value) * 1e-6d,
+ ElectricConductanceUnit.Microsiemens => (_value) * 1e-6d,
+ ElectricConductanceUnit.Millimho => (_value) * 1e-3d,
+ ElectricConductanceUnit.Millisiemens => (_value) * 1e-3d,
+ ElectricConductanceUnit.Nanomho => (_value) * 1e-9d,
+ ElectricConductanceUnit.Nanosiemens => (_value) * 1e-9d,
+ ElectricConductanceUnit.Siemens => _value,
+ ElectricConductanceUnit.Teramho => (_value) * 1e12d,
+ ElectricConductanceUnit.Terasiemens => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricConductanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricConductanceUnit.Gigamho => (baseUnitValue) / 1e9d,
+ ElectricConductanceUnit.Gigasiemens => (baseUnitValue) / 1e9d,
+ ElectricConductanceUnit.Kilomho => (baseUnitValue) / 1e3d,
+ ElectricConductanceUnit.Kilosiemens => (baseUnitValue) / 1e3d,
+ ElectricConductanceUnit.Megamho => (baseUnitValue) / 1e6d,
+ ElectricConductanceUnit.Megasiemens => (baseUnitValue) / 1e6d,
+ ElectricConductanceUnit.Mho => baseUnitValue,
+ ElectricConductanceUnit.Micromho => (baseUnitValue) / 1e-6d,
+ ElectricConductanceUnit.Microsiemens => (baseUnitValue) / 1e-6d,
+ ElectricConductanceUnit.Millimho => (baseUnitValue) / 1e-3d,
+ ElectricConductanceUnit.Millisiemens => (baseUnitValue) / 1e-3d,
+ ElectricConductanceUnit.Nanomho => (baseUnitValue) / 1e-9d,
+ ElectricConductanceUnit.Nanosiemens => (baseUnitValue) / 1e-9d,
+ ElectricConductanceUnit.Siemens => baseUnitValue,
+ ElectricConductanceUnit.Teramho => (baseUnitValue) / 1e12d,
+ ElectricConductanceUnit.Terasiemens => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductivity.g.cs
index dcc2d1a6ef..0131f30065 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductivity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricConductivity.g.cs
@@ -158,63 +158,63 @@ public static ElectricConductivity From(double value, ElectricConductivityUnit f
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricConductivityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricConductivity to another ElectricConductivity with the unit representation .
- ///
- /// A ElectricConductivity with the specified unit.
- public ElectricConductivity ToUnit(ElectricConductivityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricConductivity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricConductivityUnit.MicrosiemensPerCentimeter => (_value * 1e2) * 1e-6d,
- ElectricConductivityUnit.MillisiemensPerCentimeter => (_value * 1e2) * 1e-3d,
- ElectricConductivityUnit.SiemensPerCentimeter => _value * 1e2,
- ElectricConductivityUnit.SiemensPerFoot => _value / 0.3048,
- ElectricConductivityUnit.SiemensPerInch => _value / 2.54e-2,
- ElectricConductivityUnit.SiemensPerMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricConductivityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricConductivityUnit.MicrosiemensPerCentimeter => (baseUnitValue / 1e2) / 1e-6d,
- ElectricConductivityUnit.MillisiemensPerCentimeter => (baseUnitValue / 1e2) / 1e-3d,
- ElectricConductivityUnit.SiemensPerCentimeter => baseUnitValue / 1e2,
- ElectricConductivityUnit.SiemensPerFoot => baseUnitValue * 0.3048,
- ElectricConductivityUnit.SiemensPerInch => baseUnitValue * 2.54e-2,
- ElectricConductivityUnit.SiemensPerMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricConductivityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricConductivity to another ElectricConductivity with the unit representation .
+ ///
+ /// A ElectricConductivity with the specified unit.
+ public ElectricConductivity ToUnit(ElectricConductivityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricConductivity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricConductivityUnit.MicrosiemensPerCentimeter => (_value * 1e2) * 1e-6d,
+ ElectricConductivityUnit.MillisiemensPerCentimeter => (_value * 1e2) * 1e-3d,
+ ElectricConductivityUnit.SiemensPerCentimeter => _value * 1e2,
+ ElectricConductivityUnit.SiemensPerFoot => _value / 0.3048,
+ ElectricConductivityUnit.SiemensPerInch => _value / 2.54e-2,
+ ElectricConductivityUnit.SiemensPerMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricConductivityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricConductivityUnit.MicrosiemensPerCentimeter => (baseUnitValue / 1e2) / 1e-6d,
+ ElectricConductivityUnit.MillisiemensPerCentimeter => (baseUnitValue / 1e2) / 1e-3d,
+ ElectricConductivityUnit.SiemensPerCentimeter => baseUnitValue / 1e2,
+ ElectricConductivityUnit.SiemensPerFoot => baseUnitValue * 0.3048,
+ ElectricConductivityUnit.SiemensPerInch => baseUnitValue * 2.54e-2,
+ ElectricConductivityUnit.SiemensPerMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrent.g.cs
index b72fdf8595..874e6062eb 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrent.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrent.g.cs
@@ -188,69 +188,69 @@ public static ElectricCurrent From(double value, ElectricCurrentUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricCurrentUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricCurrent to another ElectricCurrent with the unit representation .
- ///
- /// A ElectricCurrent with the specified unit.
- public ElectricCurrent ToUnit(ElectricCurrentUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricCurrent(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricCurrentUnit.Ampere => _value,
- ElectricCurrentUnit.Centiampere => (_value) * 1e-2d,
- ElectricCurrentUnit.Femtoampere => (_value) * 1e-15d,
- ElectricCurrentUnit.Kiloampere => (_value) * 1e3d,
- ElectricCurrentUnit.Megaampere => (_value) * 1e6d,
- ElectricCurrentUnit.Microampere => (_value) * 1e-6d,
- ElectricCurrentUnit.Milliampere => (_value) * 1e-3d,
- ElectricCurrentUnit.Nanoampere => (_value) * 1e-9d,
- ElectricCurrentUnit.Picoampere => (_value) * 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricCurrentUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricCurrentUnit.Ampere => baseUnitValue,
- ElectricCurrentUnit.Centiampere => (baseUnitValue) / 1e-2d,
- ElectricCurrentUnit.Femtoampere => (baseUnitValue) / 1e-15d,
- ElectricCurrentUnit.Kiloampere => (baseUnitValue) / 1e3d,
- ElectricCurrentUnit.Megaampere => (baseUnitValue) / 1e6d,
- ElectricCurrentUnit.Microampere => (baseUnitValue) / 1e-6d,
- ElectricCurrentUnit.Milliampere => (baseUnitValue) / 1e-3d,
- ElectricCurrentUnit.Nanoampere => (baseUnitValue) / 1e-9d,
- ElectricCurrentUnit.Picoampere => (baseUnitValue) / 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricCurrentUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricCurrent to another ElectricCurrent with the unit representation .
+ ///
+ /// A ElectricCurrent with the specified unit.
+ public ElectricCurrent ToUnit(ElectricCurrentUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricCurrent(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricCurrentUnit.Ampere => _value,
+ ElectricCurrentUnit.Centiampere => (_value) * 1e-2d,
+ ElectricCurrentUnit.Femtoampere => (_value) * 1e-15d,
+ ElectricCurrentUnit.Kiloampere => (_value) * 1e3d,
+ ElectricCurrentUnit.Megaampere => (_value) * 1e6d,
+ ElectricCurrentUnit.Microampere => (_value) * 1e-6d,
+ ElectricCurrentUnit.Milliampere => (_value) * 1e-3d,
+ ElectricCurrentUnit.Nanoampere => (_value) * 1e-9d,
+ ElectricCurrentUnit.Picoampere => (_value) * 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricCurrentUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricCurrentUnit.Ampere => baseUnitValue,
+ ElectricCurrentUnit.Centiampere => (baseUnitValue) / 1e-2d,
+ ElectricCurrentUnit.Femtoampere => (baseUnitValue) / 1e-15d,
+ ElectricCurrentUnit.Kiloampere => (baseUnitValue) / 1e3d,
+ ElectricCurrentUnit.Megaampere => (baseUnitValue) / 1e6d,
+ ElectricCurrentUnit.Microampere => (baseUnitValue) / 1e-6d,
+ ElectricCurrentUnit.Milliampere => (baseUnitValue) / 1e-3d,
+ ElectricCurrentUnit.Nanoampere => (baseUnitValue) / 1e-9d,
+ ElectricCurrentUnit.Picoampere => (baseUnitValue) / 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs
index ab7ba48bdc..3689e4385b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs
@@ -128,57 +128,57 @@ public static ElectricCurrentDensity From(double value, ElectricCurrentDensityUn
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricCurrentDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricCurrentDensity to another ElectricCurrentDensity with the unit representation .
- ///
- /// A ElectricCurrentDensity with the specified unit.
- public ElectricCurrentDensity ToUnit(ElectricCurrentDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricCurrentDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricCurrentDensityUnit.AmperePerSquareFoot => _value / 9.290304e-2,
- ElectricCurrentDensityUnit.AmperePerSquareInch => _value / 0.00064516,
- ElectricCurrentDensityUnit.AmperePerSquareMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricCurrentDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricCurrentDensityUnit.AmperePerSquareFoot => baseUnitValue * 9.290304e-2,
- ElectricCurrentDensityUnit.AmperePerSquareInch => baseUnitValue * 0.00064516,
- ElectricCurrentDensityUnit.AmperePerSquareMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricCurrentDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricCurrentDensity to another ElectricCurrentDensity with the unit representation .
+ ///
+ /// A ElectricCurrentDensity with the specified unit.
+ public ElectricCurrentDensity ToUnit(ElectricCurrentDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricCurrentDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricCurrentDensityUnit.AmperePerSquareFoot => _value / 9.290304e-2,
+ ElectricCurrentDensityUnit.AmperePerSquareInch => _value / 0.00064516,
+ ElectricCurrentDensityUnit.AmperePerSquareMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricCurrentDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricCurrentDensityUnit.AmperePerSquareFoot => baseUnitValue * 9.290304e-2,
+ ElectricCurrentDensityUnit.AmperePerSquareInch => baseUnitValue * 0.00064516,
+ ElectricCurrentDensityUnit.AmperePerSquareMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs
index cddbfbcef7..7183fda4a5 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs
@@ -165,65 +165,65 @@ public static ElectricCurrentGradient From(double value, ElectricCurrentGradient
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricCurrentGradientUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricCurrentGradient to another ElectricCurrentGradient with the unit representation .
- ///
- /// A ElectricCurrentGradient with the specified unit.
- public ElectricCurrentGradient ToUnit(ElectricCurrentGradientUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricCurrentGradient(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricCurrentGradientUnit.AmperePerMicrosecond => _value * 1E6,
- ElectricCurrentGradientUnit.AmperePerMillisecond => _value * 1E3,
- ElectricCurrentGradientUnit.AmperePerMinute => _value / 60,
- ElectricCurrentGradientUnit.AmperePerNanosecond => _value * 1E9,
- ElectricCurrentGradientUnit.AmperePerSecond => _value,
- ElectricCurrentGradientUnit.MilliamperePerMinute => (_value / 60) * 1e-3d,
- ElectricCurrentGradientUnit.MilliamperePerSecond => (_value) * 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricCurrentGradientUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricCurrentGradientUnit.AmperePerMicrosecond => baseUnitValue / 1E6,
- ElectricCurrentGradientUnit.AmperePerMillisecond => baseUnitValue / 1E3,
- ElectricCurrentGradientUnit.AmperePerMinute => baseUnitValue * 60,
- ElectricCurrentGradientUnit.AmperePerNanosecond => baseUnitValue / 1E9,
- ElectricCurrentGradientUnit.AmperePerSecond => baseUnitValue,
- ElectricCurrentGradientUnit.MilliamperePerMinute => (baseUnitValue * 60) / 1e-3d,
- ElectricCurrentGradientUnit.MilliamperePerSecond => (baseUnitValue) / 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricCurrentGradientUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricCurrentGradient to another ElectricCurrentGradient with the unit representation .
+ ///
+ /// A ElectricCurrentGradient with the specified unit.
+ public ElectricCurrentGradient ToUnit(ElectricCurrentGradientUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricCurrentGradient(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricCurrentGradientUnit.AmperePerMicrosecond => _value * 1E6,
+ ElectricCurrentGradientUnit.AmperePerMillisecond => _value * 1E3,
+ ElectricCurrentGradientUnit.AmperePerMinute => _value / 60,
+ ElectricCurrentGradientUnit.AmperePerNanosecond => _value * 1E9,
+ ElectricCurrentGradientUnit.AmperePerSecond => _value,
+ ElectricCurrentGradientUnit.MilliamperePerMinute => (_value / 60) * 1e-3d,
+ ElectricCurrentGradientUnit.MilliamperePerSecond => (_value) * 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricCurrentGradientUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricCurrentGradientUnit.AmperePerMicrosecond => baseUnitValue / 1E6,
+ ElectricCurrentGradientUnit.AmperePerMillisecond => baseUnitValue / 1E3,
+ ElectricCurrentGradientUnit.AmperePerMinute => baseUnitValue * 60,
+ ElectricCurrentGradientUnit.AmperePerNanosecond => baseUnitValue / 1E9,
+ ElectricCurrentGradientUnit.AmperePerSecond => baseUnitValue,
+ ElectricCurrentGradientUnit.MilliamperePerMinute => (baseUnitValue * 60) / 1e-3d,
+ ElectricCurrentGradientUnit.MilliamperePerSecond => (baseUnitValue) / 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricField.g.cs
index 0d5c1ae132..4acc2ea9c7 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricField.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricField.g.cs
@@ -108,53 +108,53 @@ public static ElectricField From(double value, ElectricFieldUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricFieldUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricField to another ElectricField with the unit representation .
- ///
- /// A ElectricField with the specified unit.
- public ElectricField ToUnit(ElectricFieldUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricField(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricFieldUnit.VoltPerMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricFieldUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricFieldUnit.VoltPerMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricFieldUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricField to another ElectricField with the unit representation .
+ ///
+ /// A ElectricField with the specified unit.
+ public ElectricField ToUnit(ElectricFieldUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricField(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricFieldUnit.VoltPerMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricFieldUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricFieldUnit.VoltPerMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricImpedance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricImpedance.g.cs
index e6629ce635..28d067de94 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricImpedance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricImpedance.g.cs
@@ -179,67 +179,67 @@ public static ElectricImpedance From(double value, ElectricImpedanceUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricImpedanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricImpedance to another ElectricImpedance with the unit representation .
- ///
- /// A ElectricImpedance with the specified unit.
- public ElectricImpedance ToUnit(ElectricImpedanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricImpedance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricImpedanceUnit.Gigaohm => (_value) * 1e9d,
- ElectricImpedanceUnit.Kiloohm => (_value) * 1e3d,
- ElectricImpedanceUnit.Megaohm => (_value) * 1e6d,
- ElectricImpedanceUnit.Microohm => (_value) * 1e-6d,
- ElectricImpedanceUnit.Milliohm => (_value) * 1e-3d,
- ElectricImpedanceUnit.Nanoohm => (_value) * 1e-9d,
- ElectricImpedanceUnit.Ohm => _value,
- ElectricImpedanceUnit.Teraohm => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricImpedanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricImpedanceUnit.Gigaohm => (baseUnitValue) / 1e9d,
- ElectricImpedanceUnit.Kiloohm => (baseUnitValue) / 1e3d,
- ElectricImpedanceUnit.Megaohm => (baseUnitValue) / 1e6d,
- ElectricImpedanceUnit.Microohm => (baseUnitValue) / 1e-6d,
- ElectricImpedanceUnit.Milliohm => (baseUnitValue) / 1e-3d,
- ElectricImpedanceUnit.Nanoohm => (baseUnitValue) / 1e-9d,
- ElectricImpedanceUnit.Ohm => baseUnitValue,
- ElectricImpedanceUnit.Teraohm => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricImpedanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricImpedance to another ElectricImpedance with the unit representation .
+ ///
+ /// A ElectricImpedance with the specified unit.
+ public ElectricImpedance ToUnit(ElectricImpedanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricImpedance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricImpedanceUnit.Gigaohm => (_value) * 1e9d,
+ ElectricImpedanceUnit.Kiloohm => (_value) * 1e3d,
+ ElectricImpedanceUnit.Megaohm => (_value) * 1e6d,
+ ElectricImpedanceUnit.Microohm => (_value) * 1e-6d,
+ ElectricImpedanceUnit.Milliohm => (_value) * 1e-3d,
+ ElectricImpedanceUnit.Nanoohm => (_value) * 1e-9d,
+ ElectricImpedanceUnit.Ohm => _value,
+ ElectricImpedanceUnit.Teraohm => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricImpedanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricImpedanceUnit.Gigaohm => (baseUnitValue) / 1e9d,
+ ElectricImpedanceUnit.Kiloohm => (baseUnitValue) / 1e3d,
+ ElectricImpedanceUnit.Megaohm => (baseUnitValue) / 1e6d,
+ ElectricImpedanceUnit.Microohm => (baseUnitValue) / 1e-6d,
+ ElectricImpedanceUnit.Milliohm => (baseUnitValue) / 1e-3d,
+ ElectricImpedanceUnit.Nanoohm => (baseUnitValue) / 1e-9d,
+ ElectricImpedanceUnit.Ohm => baseUnitValue,
+ ElectricImpedanceUnit.Teraohm => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricInductance.g.cs
index 0d7654d801..e268927558 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricInductance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricInductance.g.cs
@@ -148,61 +148,61 @@ public static ElectricInductance From(double value, ElectricInductanceUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricInductanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricInductance to another ElectricInductance with the unit representation .
- ///
- /// A ElectricInductance with the specified unit.
- public ElectricInductance ToUnit(ElectricInductanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricInductance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricInductanceUnit.Henry => _value,
- ElectricInductanceUnit.Microhenry => (_value) * 1e-6d,
- ElectricInductanceUnit.Millihenry => (_value) * 1e-3d,
- ElectricInductanceUnit.Nanohenry => (_value) * 1e-9d,
- ElectricInductanceUnit.Picohenry => (_value) * 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricInductanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricInductanceUnit.Henry => baseUnitValue,
- ElectricInductanceUnit.Microhenry => (baseUnitValue) / 1e-6d,
- ElectricInductanceUnit.Millihenry => (baseUnitValue) / 1e-3d,
- ElectricInductanceUnit.Nanohenry => (baseUnitValue) / 1e-9d,
- ElectricInductanceUnit.Picohenry => (baseUnitValue) / 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricInductanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricInductance to another ElectricInductance with the unit representation .
+ ///
+ /// A ElectricInductance with the specified unit.
+ public ElectricInductance ToUnit(ElectricInductanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricInductance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricInductanceUnit.Henry => _value,
+ ElectricInductanceUnit.Microhenry => (_value) * 1e-6d,
+ ElectricInductanceUnit.Millihenry => (_value) * 1e-3d,
+ ElectricInductanceUnit.Nanohenry => (_value) * 1e-9d,
+ ElectricInductanceUnit.Picohenry => (_value) * 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricInductanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricInductanceUnit.Henry => baseUnitValue,
+ ElectricInductanceUnit.Microhenry => (baseUnitValue) / 1e-6d,
+ ElectricInductanceUnit.Millihenry => (baseUnitValue) / 1e-3d,
+ ElectricInductanceUnit.Nanohenry => (baseUnitValue) / 1e-9d,
+ ElectricInductanceUnit.Picohenry => (baseUnitValue) / 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotential.g.cs
index ed4f945693..e4fa4044a7 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotential.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotential.g.cs
@@ -158,63 +158,63 @@ public static ElectricPotential From(double value, ElectricPotentialUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricPotentialUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricPotential to another ElectricPotential with the unit representation .
- ///
- /// A ElectricPotential with the specified unit.
- public ElectricPotential ToUnit(ElectricPotentialUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricPotential(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricPotentialUnit.Kilovolt => (_value) * 1e3d,
- ElectricPotentialUnit.Megavolt => (_value) * 1e6d,
- ElectricPotentialUnit.Microvolt => (_value) * 1e-6d,
- ElectricPotentialUnit.Millivolt => (_value) * 1e-3d,
- ElectricPotentialUnit.Nanovolt => (_value) * 1e-9d,
- ElectricPotentialUnit.Volt => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricPotentialUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricPotentialUnit.Kilovolt => (baseUnitValue) / 1e3d,
- ElectricPotentialUnit.Megavolt => (baseUnitValue) / 1e6d,
- ElectricPotentialUnit.Microvolt => (baseUnitValue) / 1e-6d,
- ElectricPotentialUnit.Millivolt => (baseUnitValue) / 1e-3d,
- ElectricPotentialUnit.Nanovolt => (baseUnitValue) / 1e-9d,
- ElectricPotentialUnit.Volt => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricPotentialUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricPotential to another ElectricPotential with the unit representation .
+ ///
+ /// A ElectricPotential with the specified unit.
+ public ElectricPotential ToUnit(ElectricPotentialUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricPotential(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricPotentialUnit.Kilovolt => (_value) * 1e3d,
+ ElectricPotentialUnit.Megavolt => (_value) * 1e6d,
+ ElectricPotentialUnit.Microvolt => (_value) * 1e-6d,
+ ElectricPotentialUnit.Millivolt => (_value) * 1e-3d,
+ ElectricPotentialUnit.Nanovolt => (_value) * 1e-9d,
+ ElectricPotentialUnit.Volt => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricPotentialUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricPotentialUnit.Kilovolt => (baseUnitValue) / 1e3d,
+ ElectricPotentialUnit.Megavolt => (baseUnitValue) / 1e6d,
+ ElectricPotentialUnit.Microvolt => (baseUnitValue) / 1e-6d,
+ ElectricPotentialUnit.Millivolt => (baseUnitValue) / 1e-3d,
+ ElectricPotentialUnit.Nanovolt => (baseUnitValue) / 1e-9d,
+ ElectricPotentialUnit.Volt => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
index 4840493913..1f7a55fb08 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
@@ -295,91 +295,91 @@ public static ElectricPotentialChangeRate From(double value, ElectricPotentialCh
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricPotentialChangeRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricPotentialChangeRate to another ElectricPotentialChangeRate with the unit representation .
- ///
- /// A ElectricPotentialChangeRate with the specified unit.
- public ElectricPotentialChangeRate ToUnit(ElectricPotentialChangeRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricPotentialChangeRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricPotentialChangeRateUnit.KilovoltPerHour => (_value / 3600) * 1e3d,
- ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond => (_value * 1E6) * 1e3d,
- ElectricPotentialChangeRateUnit.KilovoltPerMinute => (_value / 60) * 1e3d,
- ElectricPotentialChangeRateUnit.KilovoltPerSecond => (_value) * 1e3d,
- ElectricPotentialChangeRateUnit.MegavoltPerHour => (_value / 3600) * 1e6d,
- ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond => (_value * 1E6) * 1e6d,
- ElectricPotentialChangeRateUnit.MegavoltPerMinute => (_value / 60) * 1e6d,
- ElectricPotentialChangeRateUnit.MegavoltPerSecond => (_value) * 1e6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerHour => (_value / 3600) * 1e-6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond => (_value * 1E6) * 1e-6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerMinute => (_value / 60) * 1e-6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerSecond => (_value) * 1e-6d,
- ElectricPotentialChangeRateUnit.MillivoltPerHour => (_value / 3600) * 1e-3d,
- ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond => (_value * 1E6) * 1e-3d,
- ElectricPotentialChangeRateUnit.MillivoltPerMinute => (_value / 60) * 1e-3d,
- ElectricPotentialChangeRateUnit.MillivoltPerSecond => (_value) * 1e-3d,
- ElectricPotentialChangeRateUnit.VoltPerHour => _value / 3600,
- ElectricPotentialChangeRateUnit.VoltPerMicrosecond => _value * 1E6,
- ElectricPotentialChangeRateUnit.VoltPerMinute => _value / 60,
- ElectricPotentialChangeRateUnit.VoltPerSecond => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricPotentialChangeRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricPotentialChangeRateUnit.KilovoltPerHour => (baseUnitValue * 3600) / 1e3d,
- ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond => (baseUnitValue / 1E6) / 1e3d,
- ElectricPotentialChangeRateUnit.KilovoltPerMinute => (baseUnitValue * 60) / 1e3d,
- ElectricPotentialChangeRateUnit.KilovoltPerSecond => (baseUnitValue) / 1e3d,
- ElectricPotentialChangeRateUnit.MegavoltPerHour => (baseUnitValue * 3600) / 1e6d,
- ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond => (baseUnitValue / 1E6) / 1e6d,
- ElectricPotentialChangeRateUnit.MegavoltPerMinute => (baseUnitValue * 60) / 1e6d,
- ElectricPotentialChangeRateUnit.MegavoltPerSecond => (baseUnitValue) / 1e6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerHour => (baseUnitValue * 3600) / 1e-6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond => (baseUnitValue / 1E6) / 1e-6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerMinute => (baseUnitValue * 60) / 1e-6d,
- ElectricPotentialChangeRateUnit.MicrovoltPerSecond => (baseUnitValue) / 1e-6d,
- ElectricPotentialChangeRateUnit.MillivoltPerHour => (baseUnitValue * 3600) / 1e-3d,
- ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond => (baseUnitValue / 1E6) / 1e-3d,
- ElectricPotentialChangeRateUnit.MillivoltPerMinute => (baseUnitValue * 60) / 1e-3d,
- ElectricPotentialChangeRateUnit.MillivoltPerSecond => (baseUnitValue) / 1e-3d,
- ElectricPotentialChangeRateUnit.VoltPerHour => baseUnitValue * 3600,
- ElectricPotentialChangeRateUnit.VoltPerMicrosecond => baseUnitValue / 1E6,
- ElectricPotentialChangeRateUnit.VoltPerMinute => baseUnitValue * 60,
- ElectricPotentialChangeRateUnit.VoltPerSecond => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricPotentialChangeRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricPotentialChangeRate to another ElectricPotentialChangeRate with the unit representation .
+ ///
+ /// A ElectricPotentialChangeRate with the specified unit.
+ public ElectricPotentialChangeRate ToUnit(ElectricPotentialChangeRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricPotentialChangeRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricPotentialChangeRateUnit.KilovoltPerHour => (_value / 3600) * 1e3d,
+ ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond => (_value * 1E6) * 1e3d,
+ ElectricPotentialChangeRateUnit.KilovoltPerMinute => (_value / 60) * 1e3d,
+ ElectricPotentialChangeRateUnit.KilovoltPerSecond => (_value) * 1e3d,
+ ElectricPotentialChangeRateUnit.MegavoltPerHour => (_value / 3600) * 1e6d,
+ ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond => (_value * 1E6) * 1e6d,
+ ElectricPotentialChangeRateUnit.MegavoltPerMinute => (_value / 60) * 1e6d,
+ ElectricPotentialChangeRateUnit.MegavoltPerSecond => (_value) * 1e6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerHour => (_value / 3600) * 1e-6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond => (_value * 1E6) * 1e-6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerMinute => (_value / 60) * 1e-6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerSecond => (_value) * 1e-6d,
+ ElectricPotentialChangeRateUnit.MillivoltPerHour => (_value / 3600) * 1e-3d,
+ ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond => (_value * 1E6) * 1e-3d,
+ ElectricPotentialChangeRateUnit.MillivoltPerMinute => (_value / 60) * 1e-3d,
+ ElectricPotentialChangeRateUnit.MillivoltPerSecond => (_value) * 1e-3d,
+ ElectricPotentialChangeRateUnit.VoltPerHour => _value / 3600,
+ ElectricPotentialChangeRateUnit.VoltPerMicrosecond => _value * 1E6,
+ ElectricPotentialChangeRateUnit.VoltPerMinute => _value / 60,
+ ElectricPotentialChangeRateUnit.VoltPerSecond => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricPotentialChangeRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricPotentialChangeRateUnit.KilovoltPerHour => (baseUnitValue * 3600) / 1e3d,
+ ElectricPotentialChangeRateUnit.KilovoltPerMicrosecond => (baseUnitValue / 1E6) / 1e3d,
+ ElectricPotentialChangeRateUnit.KilovoltPerMinute => (baseUnitValue * 60) / 1e3d,
+ ElectricPotentialChangeRateUnit.KilovoltPerSecond => (baseUnitValue) / 1e3d,
+ ElectricPotentialChangeRateUnit.MegavoltPerHour => (baseUnitValue * 3600) / 1e6d,
+ ElectricPotentialChangeRateUnit.MegavoltPerMicrosecond => (baseUnitValue / 1E6) / 1e6d,
+ ElectricPotentialChangeRateUnit.MegavoltPerMinute => (baseUnitValue * 60) / 1e6d,
+ ElectricPotentialChangeRateUnit.MegavoltPerSecond => (baseUnitValue) / 1e6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerHour => (baseUnitValue * 3600) / 1e-6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerMicrosecond => (baseUnitValue / 1E6) / 1e-6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerMinute => (baseUnitValue * 60) / 1e-6d,
+ ElectricPotentialChangeRateUnit.MicrovoltPerSecond => (baseUnitValue) / 1e-6d,
+ ElectricPotentialChangeRateUnit.MillivoltPerHour => (baseUnitValue * 3600) / 1e-3d,
+ ElectricPotentialChangeRateUnit.MillivoltPerMicrosecond => (baseUnitValue / 1E6) / 1e-3d,
+ ElectricPotentialChangeRateUnit.MillivoltPerMinute => (baseUnitValue * 60) / 1e-3d,
+ ElectricPotentialChangeRateUnit.MillivoltPerSecond => (baseUnitValue) / 1e-3d,
+ ElectricPotentialChangeRateUnit.VoltPerHour => baseUnitValue * 3600,
+ ElectricPotentialChangeRateUnit.VoltPerMicrosecond => baseUnitValue / 1E6,
+ ElectricPotentialChangeRateUnit.VoltPerMinute => baseUnitValue * 60,
+ ElectricPotentialChangeRateUnit.VoltPerSecond => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactance.g.cs
index df246179fc..3de2676b17 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactance.g.cs
@@ -178,67 +178,67 @@ public static ElectricReactance From(double value, ElectricReactanceUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricReactanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricReactance to another ElectricReactance with the unit representation .
- ///
- /// A ElectricReactance with the specified unit.
- public ElectricReactance ToUnit(ElectricReactanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricReactance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricReactanceUnit.Gigaohm => (_value) * 1e9d,
- ElectricReactanceUnit.Kiloohm => (_value) * 1e3d,
- ElectricReactanceUnit.Megaohm => (_value) * 1e6d,
- ElectricReactanceUnit.Microohm => (_value) * 1e-6d,
- ElectricReactanceUnit.Milliohm => (_value) * 1e-3d,
- ElectricReactanceUnit.Nanoohm => (_value) * 1e-9d,
- ElectricReactanceUnit.Ohm => _value,
- ElectricReactanceUnit.Teraohm => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricReactanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricReactanceUnit.Gigaohm => (baseUnitValue) / 1e9d,
- ElectricReactanceUnit.Kiloohm => (baseUnitValue) / 1e3d,
- ElectricReactanceUnit.Megaohm => (baseUnitValue) / 1e6d,
- ElectricReactanceUnit.Microohm => (baseUnitValue) / 1e-6d,
- ElectricReactanceUnit.Milliohm => (baseUnitValue) / 1e-3d,
- ElectricReactanceUnit.Nanoohm => (baseUnitValue) / 1e-9d,
- ElectricReactanceUnit.Ohm => baseUnitValue,
- ElectricReactanceUnit.Teraohm => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricReactanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricReactance to another ElectricReactance with the unit representation .
+ ///
+ /// A ElectricReactance with the specified unit.
+ public ElectricReactance ToUnit(ElectricReactanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricReactance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricReactanceUnit.Gigaohm => (_value) * 1e9d,
+ ElectricReactanceUnit.Kiloohm => (_value) * 1e3d,
+ ElectricReactanceUnit.Megaohm => (_value) * 1e6d,
+ ElectricReactanceUnit.Microohm => (_value) * 1e-6d,
+ ElectricReactanceUnit.Milliohm => (_value) * 1e-3d,
+ ElectricReactanceUnit.Nanoohm => (_value) * 1e-9d,
+ ElectricReactanceUnit.Ohm => _value,
+ ElectricReactanceUnit.Teraohm => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricReactanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricReactanceUnit.Gigaohm => (baseUnitValue) / 1e9d,
+ ElectricReactanceUnit.Kiloohm => (baseUnitValue) / 1e3d,
+ ElectricReactanceUnit.Megaohm => (baseUnitValue) / 1e6d,
+ ElectricReactanceUnit.Microohm => (baseUnitValue) / 1e-6d,
+ ElectricReactanceUnit.Milliohm => (baseUnitValue) / 1e-3d,
+ ElectricReactanceUnit.Nanoohm => (baseUnitValue) / 1e-9d,
+ ElectricReactanceUnit.Ohm => baseUnitValue,
+ ElectricReactanceUnit.Teraohm => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs
index 3bb96eec8c..99b42cf474 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactiveEnergy.g.cs
@@ -125,57 +125,57 @@ public static ElectricReactiveEnergy From(double value, ElectricReactiveEnergyUn
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricReactiveEnergyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricReactiveEnergy to another ElectricReactiveEnergy with the unit representation .
- ///
- /// A ElectricReactiveEnergy with the specified unit.
- public ElectricReactiveEnergy ToUnit(ElectricReactiveEnergyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricReactiveEnergy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricReactiveEnergyUnit.KilovoltampereReactiveHour => (_value) * 1e3d,
- ElectricReactiveEnergyUnit.MegavoltampereReactiveHour => (_value) * 1e6d,
- ElectricReactiveEnergyUnit.VoltampereReactiveHour => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricReactiveEnergyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricReactiveEnergyUnit.KilovoltampereReactiveHour => (baseUnitValue) / 1e3d,
- ElectricReactiveEnergyUnit.MegavoltampereReactiveHour => (baseUnitValue) / 1e6d,
- ElectricReactiveEnergyUnit.VoltampereReactiveHour => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricReactiveEnergyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricReactiveEnergy to another ElectricReactiveEnergy with the unit representation .
+ ///
+ /// A ElectricReactiveEnergy with the specified unit.
+ public ElectricReactiveEnergy ToUnit(ElectricReactiveEnergyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricReactiveEnergy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricReactiveEnergyUnit.KilovoltampereReactiveHour => (_value) * 1e3d,
+ ElectricReactiveEnergyUnit.MegavoltampereReactiveHour => (_value) * 1e6d,
+ ElectricReactiveEnergyUnit.VoltampereReactiveHour => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricReactiveEnergyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricReactiveEnergyUnit.KilovoltampereReactiveHour => (baseUnitValue) / 1e3d,
+ ElectricReactiveEnergyUnit.MegavoltampereReactiveHour => (baseUnitValue) / 1e6d,
+ ElectricReactiveEnergyUnit.VoltampereReactiveHour => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactivePower.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactivePower.g.cs
index e9206453d5..44e41ee214 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactivePower.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricReactivePower.g.cs
@@ -138,59 +138,59 @@ public static ElectricReactivePower From(double value, ElectricReactivePowerUnit
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricReactivePowerUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricReactivePower to another ElectricReactivePower with the unit representation .
- ///
- /// A ElectricReactivePower with the specified unit.
- public ElectricReactivePower ToUnit(ElectricReactivePowerUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricReactivePower(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricReactivePowerUnit.GigavoltampereReactive => (_value) * 1e9d,
- ElectricReactivePowerUnit.KilovoltampereReactive => (_value) * 1e3d,
- ElectricReactivePowerUnit.MegavoltampereReactive => (_value) * 1e6d,
- ElectricReactivePowerUnit.VoltampereReactive => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricReactivePowerUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricReactivePowerUnit.GigavoltampereReactive => (baseUnitValue) / 1e9d,
- ElectricReactivePowerUnit.KilovoltampereReactive => (baseUnitValue) / 1e3d,
- ElectricReactivePowerUnit.MegavoltampereReactive => (baseUnitValue) / 1e6d,
- ElectricReactivePowerUnit.VoltampereReactive => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricReactivePowerUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricReactivePower to another ElectricReactivePower with the unit representation .
+ ///
+ /// A ElectricReactivePower with the specified unit.
+ public ElectricReactivePower ToUnit(ElectricReactivePowerUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricReactivePower(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricReactivePowerUnit.GigavoltampereReactive => (_value) * 1e9d,
+ ElectricReactivePowerUnit.KilovoltampereReactive => (_value) * 1e3d,
+ ElectricReactivePowerUnit.MegavoltampereReactive => (_value) * 1e6d,
+ ElectricReactivePowerUnit.VoltampereReactive => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricReactivePowerUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricReactivePowerUnit.GigavoltampereReactive => (baseUnitValue) / 1e9d,
+ ElectricReactivePowerUnit.KilovoltampereReactive => (baseUnitValue) / 1e3d,
+ ElectricReactivePowerUnit.MegavoltampereReactive => (baseUnitValue) / 1e6d,
+ ElectricReactivePowerUnit.VoltampereReactive => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistance.g.cs
index 42e2b3bf6d..fff01cd288 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistance.g.cs
@@ -178,67 +178,67 @@ public static ElectricResistance From(double value, ElectricResistanceUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricResistanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricResistance to another ElectricResistance with the unit representation .
- ///
- /// A ElectricResistance with the specified unit.
- public ElectricResistance ToUnit(ElectricResistanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricResistance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricResistanceUnit.Gigaohm => (_value) * 1e9d,
- ElectricResistanceUnit.Kiloohm => (_value) * 1e3d,
- ElectricResistanceUnit.Megaohm => (_value) * 1e6d,
- ElectricResistanceUnit.Microohm => (_value) * 1e-6d,
- ElectricResistanceUnit.Milliohm => (_value) * 1e-3d,
- ElectricResistanceUnit.Nanoohm => (_value) * 1e-9d,
- ElectricResistanceUnit.Ohm => _value,
- ElectricResistanceUnit.Teraohm => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricResistanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricResistanceUnit.Gigaohm => (baseUnitValue) / 1e9d,
- ElectricResistanceUnit.Kiloohm => (baseUnitValue) / 1e3d,
- ElectricResistanceUnit.Megaohm => (baseUnitValue) / 1e6d,
- ElectricResistanceUnit.Microohm => (baseUnitValue) / 1e-6d,
- ElectricResistanceUnit.Milliohm => (baseUnitValue) / 1e-3d,
- ElectricResistanceUnit.Nanoohm => (baseUnitValue) / 1e-9d,
- ElectricResistanceUnit.Ohm => baseUnitValue,
- ElectricResistanceUnit.Teraohm => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricResistanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricResistance to another ElectricResistance with the unit representation .
+ ///
+ /// A ElectricResistance with the specified unit.
+ public ElectricResistance ToUnit(ElectricResistanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricResistance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricResistanceUnit.Gigaohm => (_value) * 1e9d,
+ ElectricResistanceUnit.Kiloohm => (_value) * 1e3d,
+ ElectricResistanceUnit.Megaohm => (_value) * 1e6d,
+ ElectricResistanceUnit.Microohm => (_value) * 1e-6d,
+ ElectricResistanceUnit.Milliohm => (_value) * 1e-3d,
+ ElectricResistanceUnit.Nanoohm => (_value) * 1e-9d,
+ ElectricResistanceUnit.Ohm => _value,
+ ElectricResistanceUnit.Teraohm => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricResistanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricResistanceUnit.Gigaohm => (baseUnitValue) / 1e9d,
+ ElectricResistanceUnit.Kiloohm => (baseUnitValue) / 1e3d,
+ ElectricResistanceUnit.Megaohm => (baseUnitValue) / 1e6d,
+ ElectricResistanceUnit.Microohm => (baseUnitValue) / 1e-6d,
+ ElectricResistanceUnit.Milliohm => (baseUnitValue) / 1e-3d,
+ ElectricResistanceUnit.Nanoohm => (baseUnitValue) / 1e-9d,
+ ElectricResistanceUnit.Ohm => baseUnitValue,
+ ElectricResistanceUnit.Teraohm => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistivity.g.cs
index f8c5f1b7c5..fc697ea6aa 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistivity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricResistivity.g.cs
@@ -238,79 +238,79 @@ public static ElectricResistivity From(double value, ElectricResistivityUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricResistivityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricResistivity to another ElectricResistivity with the unit representation .
- ///
- /// A ElectricResistivity with the specified unit.
- public ElectricResistivity ToUnit(ElectricResistivityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricResistivity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricResistivityUnit.KiloohmCentimeter => (_value / 100) * 1e3d,
- ElectricResistivityUnit.KiloohmMeter => (_value) * 1e3d,
- ElectricResistivityUnit.MegaohmCentimeter => (_value / 100) * 1e6d,
- ElectricResistivityUnit.MegaohmMeter => (_value) * 1e6d,
- ElectricResistivityUnit.MicroohmCentimeter => (_value / 100) * 1e-6d,
- ElectricResistivityUnit.MicroohmMeter => (_value) * 1e-6d,
- ElectricResistivityUnit.MilliohmCentimeter => (_value / 100) * 1e-3d,
- ElectricResistivityUnit.MilliohmMeter => (_value) * 1e-3d,
- ElectricResistivityUnit.NanoohmCentimeter => (_value / 100) * 1e-9d,
- ElectricResistivityUnit.NanoohmMeter => (_value) * 1e-9d,
- ElectricResistivityUnit.OhmCentimeter => _value / 100,
- ElectricResistivityUnit.OhmMeter => _value,
- ElectricResistivityUnit.PicoohmCentimeter => (_value / 100) * 1e-12d,
- ElectricResistivityUnit.PicoohmMeter => (_value) * 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricResistivityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricResistivityUnit.KiloohmCentimeter => (baseUnitValue * 100) / 1e3d,
- ElectricResistivityUnit.KiloohmMeter => (baseUnitValue) / 1e3d,
- ElectricResistivityUnit.MegaohmCentimeter => (baseUnitValue * 100) / 1e6d,
- ElectricResistivityUnit.MegaohmMeter => (baseUnitValue) / 1e6d,
- ElectricResistivityUnit.MicroohmCentimeter => (baseUnitValue * 100) / 1e-6d,
- ElectricResistivityUnit.MicroohmMeter => (baseUnitValue) / 1e-6d,
- ElectricResistivityUnit.MilliohmCentimeter => (baseUnitValue * 100) / 1e-3d,
- ElectricResistivityUnit.MilliohmMeter => (baseUnitValue) / 1e-3d,
- ElectricResistivityUnit.NanoohmCentimeter => (baseUnitValue * 100) / 1e-9d,
- ElectricResistivityUnit.NanoohmMeter => (baseUnitValue) / 1e-9d,
- ElectricResistivityUnit.OhmCentimeter => baseUnitValue * 100,
- ElectricResistivityUnit.OhmMeter => baseUnitValue,
- ElectricResistivityUnit.PicoohmCentimeter => (baseUnitValue * 100) / 1e-12d,
- ElectricResistivityUnit.PicoohmMeter => (baseUnitValue) / 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricResistivityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricResistivity to another ElectricResistivity with the unit representation .
+ ///
+ /// A ElectricResistivity with the specified unit.
+ public ElectricResistivity ToUnit(ElectricResistivityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricResistivity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricResistivityUnit.KiloohmCentimeter => (_value / 100) * 1e3d,
+ ElectricResistivityUnit.KiloohmMeter => (_value) * 1e3d,
+ ElectricResistivityUnit.MegaohmCentimeter => (_value / 100) * 1e6d,
+ ElectricResistivityUnit.MegaohmMeter => (_value) * 1e6d,
+ ElectricResistivityUnit.MicroohmCentimeter => (_value / 100) * 1e-6d,
+ ElectricResistivityUnit.MicroohmMeter => (_value) * 1e-6d,
+ ElectricResistivityUnit.MilliohmCentimeter => (_value / 100) * 1e-3d,
+ ElectricResistivityUnit.MilliohmMeter => (_value) * 1e-3d,
+ ElectricResistivityUnit.NanoohmCentimeter => (_value / 100) * 1e-9d,
+ ElectricResistivityUnit.NanoohmMeter => (_value) * 1e-9d,
+ ElectricResistivityUnit.OhmCentimeter => _value / 100,
+ ElectricResistivityUnit.OhmMeter => _value,
+ ElectricResistivityUnit.PicoohmCentimeter => (_value / 100) * 1e-12d,
+ ElectricResistivityUnit.PicoohmMeter => (_value) * 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricResistivityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricResistivityUnit.KiloohmCentimeter => (baseUnitValue * 100) / 1e3d,
+ ElectricResistivityUnit.KiloohmMeter => (baseUnitValue) / 1e3d,
+ ElectricResistivityUnit.MegaohmCentimeter => (baseUnitValue * 100) / 1e6d,
+ ElectricResistivityUnit.MegaohmMeter => (baseUnitValue) / 1e6d,
+ ElectricResistivityUnit.MicroohmCentimeter => (baseUnitValue * 100) / 1e-6d,
+ ElectricResistivityUnit.MicroohmMeter => (baseUnitValue) / 1e-6d,
+ ElectricResistivityUnit.MilliohmCentimeter => (baseUnitValue * 100) / 1e-3d,
+ ElectricResistivityUnit.MilliohmMeter => (baseUnitValue) / 1e-3d,
+ ElectricResistivityUnit.NanoohmCentimeter => (baseUnitValue * 100) / 1e-9d,
+ ElectricResistivityUnit.NanoohmMeter => (baseUnitValue) / 1e-9d,
+ ElectricResistivityUnit.OhmCentimeter => baseUnitValue * 100,
+ ElectricResistivityUnit.OhmMeter => baseUnitValue,
+ ElectricResistivityUnit.PicoohmCentimeter => (baseUnitValue * 100) / 1e-12d,
+ ElectricResistivityUnit.PicoohmMeter => (baseUnitValue) / 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs
index 4ef70185c5..62cf4c74ab 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs
@@ -128,57 +128,57 @@ public static ElectricSurfaceChargeDensity From(double value, ElectricSurfaceCha
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricSurfaceChargeDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricSurfaceChargeDensity to another ElectricSurfaceChargeDensity with the unit representation .
- ///
- /// A ElectricSurfaceChargeDensity with the specified unit.
- public ElectricSurfaceChargeDensity ToUnit(ElectricSurfaceChargeDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricSurfaceChargeDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter => _value * 1.0e4,
- ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch => _value / 0.00064516,
- ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricSurfaceChargeDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter => baseUnitValue / 1.0e4,
- ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch => baseUnitValue * 0.00064516,
- ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricSurfaceChargeDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricSurfaceChargeDensity to another ElectricSurfaceChargeDensity with the unit representation .
+ ///
+ /// A ElectricSurfaceChargeDensity with the specified unit.
+ public ElectricSurfaceChargeDensity ToUnit(ElectricSurfaceChargeDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricSurfaceChargeDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter => _value * 1.0e4,
+ ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch => _value / 0.00064516,
+ ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricSurfaceChargeDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricSurfaceChargeDensityUnit.CoulombPerSquareCentimeter => baseUnitValue / 1.0e4,
+ ElectricSurfaceChargeDensityUnit.CoulombPerSquareInch => baseUnitValue * 0.00064516,
+ ElectricSurfaceChargeDensityUnit.CoulombPerSquareMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSusceptance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSusceptance.g.cs
index 3c157cc5c3..bdca16586c 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSusceptance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ElectricSusceptance.g.cs
@@ -258,83 +258,83 @@ public static ElectricSusceptance From(double value, ElectricSusceptanceUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ElectricSusceptanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ElectricSusceptance to another ElectricSusceptance with the unit representation .
- ///
- /// A ElectricSusceptance with the specified unit.
- public ElectricSusceptance ToUnit(ElectricSusceptanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ElectricSusceptance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ElectricSusceptanceUnit.Gigamho => (_value) * 1e9d,
- ElectricSusceptanceUnit.Gigasiemens => (_value) * 1e9d,
- ElectricSusceptanceUnit.Kilomho => (_value) * 1e3d,
- ElectricSusceptanceUnit.Kilosiemens => (_value) * 1e3d,
- ElectricSusceptanceUnit.Megamho => (_value) * 1e6d,
- ElectricSusceptanceUnit.Megasiemens => (_value) * 1e6d,
- ElectricSusceptanceUnit.Mho => _value,
- ElectricSusceptanceUnit.Micromho => (_value) * 1e-6d,
- ElectricSusceptanceUnit.Microsiemens => (_value) * 1e-6d,
- ElectricSusceptanceUnit.Millimho => (_value) * 1e-3d,
- ElectricSusceptanceUnit.Millisiemens => (_value) * 1e-3d,
- ElectricSusceptanceUnit.Nanomho => (_value) * 1e-9d,
- ElectricSusceptanceUnit.Nanosiemens => (_value) * 1e-9d,
- ElectricSusceptanceUnit.Siemens => _value,
- ElectricSusceptanceUnit.Teramho => (_value) * 1e12d,
- ElectricSusceptanceUnit.Terasiemens => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ElectricSusceptanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ElectricSusceptanceUnit.Gigamho => (baseUnitValue) / 1e9d,
- ElectricSusceptanceUnit.Gigasiemens => (baseUnitValue) / 1e9d,
- ElectricSusceptanceUnit.Kilomho => (baseUnitValue) / 1e3d,
- ElectricSusceptanceUnit.Kilosiemens => (baseUnitValue) / 1e3d,
- ElectricSusceptanceUnit.Megamho => (baseUnitValue) / 1e6d,
- ElectricSusceptanceUnit.Megasiemens => (baseUnitValue) / 1e6d,
- ElectricSusceptanceUnit.Mho => baseUnitValue,
- ElectricSusceptanceUnit.Micromho => (baseUnitValue) / 1e-6d,
- ElectricSusceptanceUnit.Microsiemens => (baseUnitValue) / 1e-6d,
- ElectricSusceptanceUnit.Millimho => (baseUnitValue) / 1e-3d,
- ElectricSusceptanceUnit.Millisiemens => (baseUnitValue) / 1e-3d,
- ElectricSusceptanceUnit.Nanomho => (baseUnitValue) / 1e-9d,
- ElectricSusceptanceUnit.Nanosiemens => (baseUnitValue) / 1e-9d,
- ElectricSusceptanceUnit.Siemens => baseUnitValue,
- ElectricSusceptanceUnit.Teramho => (baseUnitValue) / 1e12d,
- ElectricSusceptanceUnit.Terasiemens => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ElectricSusceptanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ElectricSusceptance to another ElectricSusceptance with the unit representation .
+ ///
+ /// A ElectricSusceptance with the specified unit.
+ public ElectricSusceptance ToUnit(ElectricSusceptanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ElectricSusceptance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ElectricSusceptanceUnit.Gigamho => (_value) * 1e9d,
+ ElectricSusceptanceUnit.Gigasiemens => (_value) * 1e9d,
+ ElectricSusceptanceUnit.Kilomho => (_value) * 1e3d,
+ ElectricSusceptanceUnit.Kilosiemens => (_value) * 1e3d,
+ ElectricSusceptanceUnit.Megamho => (_value) * 1e6d,
+ ElectricSusceptanceUnit.Megasiemens => (_value) * 1e6d,
+ ElectricSusceptanceUnit.Mho => _value,
+ ElectricSusceptanceUnit.Micromho => (_value) * 1e-6d,
+ ElectricSusceptanceUnit.Microsiemens => (_value) * 1e-6d,
+ ElectricSusceptanceUnit.Millimho => (_value) * 1e-3d,
+ ElectricSusceptanceUnit.Millisiemens => (_value) * 1e-3d,
+ ElectricSusceptanceUnit.Nanomho => (_value) * 1e-9d,
+ ElectricSusceptanceUnit.Nanosiemens => (_value) * 1e-9d,
+ ElectricSusceptanceUnit.Siemens => _value,
+ ElectricSusceptanceUnit.Teramho => (_value) * 1e12d,
+ ElectricSusceptanceUnit.Terasiemens => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ElectricSusceptanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ElectricSusceptanceUnit.Gigamho => (baseUnitValue) / 1e9d,
+ ElectricSusceptanceUnit.Gigasiemens => (baseUnitValue) / 1e9d,
+ ElectricSusceptanceUnit.Kilomho => (baseUnitValue) / 1e3d,
+ ElectricSusceptanceUnit.Kilosiemens => (baseUnitValue) / 1e3d,
+ ElectricSusceptanceUnit.Megamho => (baseUnitValue) / 1e6d,
+ ElectricSusceptanceUnit.Megasiemens => (baseUnitValue) / 1e6d,
+ ElectricSusceptanceUnit.Mho => baseUnitValue,
+ ElectricSusceptanceUnit.Micromho => (baseUnitValue) / 1e-6d,
+ ElectricSusceptanceUnit.Microsiemens => (baseUnitValue) / 1e-6d,
+ ElectricSusceptanceUnit.Millimho => (baseUnitValue) / 1e-3d,
+ ElectricSusceptanceUnit.Millisiemens => (baseUnitValue) / 1e-3d,
+ ElectricSusceptanceUnit.Nanomho => (baseUnitValue) / 1e-9d,
+ ElectricSusceptanceUnit.Nanosiemens => (baseUnitValue) / 1e-9d,
+ ElectricSusceptanceUnit.Siemens => baseUnitValue,
+ ElectricSusceptanceUnit.Teramho => (baseUnitValue) / 1e12d,
+ ElectricSusceptanceUnit.Terasiemens => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Energy.g.cs
index 3b6e4ce23a..ffc60da73a 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Energy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Energy.g.cs
@@ -495,131 +495,131 @@ public static Energy From(double value, EnergyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(EnergyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Energy to another Energy with the unit representation .
- ///
- /// A Energy with the specified unit.
- public Energy ToUnit(EnergyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Energy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- EnergyUnit.BritishThermalUnit => _value * 1055.05585262,
- EnergyUnit.Calorie => _value * 4.184,
- EnergyUnit.DecathermEc => (_value * 1.05505585262e8) * 1e1d,
- EnergyUnit.DecathermImperial => (_value * 1.05505585257348e8) * 1e1d,
- EnergyUnit.DecathermUs => (_value * 1.054804e8) * 1e1d,
- EnergyUnit.ElectronVolt => _value * 1.602176634e-19,
- EnergyUnit.Erg => _value * 1e-7,
- EnergyUnit.FootPound => _value * 1.3558179483314004,
- EnergyUnit.GigabritishThermalUnit => (_value * 1055.05585262) * 1e9d,
- EnergyUnit.GigaelectronVolt => (_value * 1.602176634e-19) * 1e9d,
- EnergyUnit.Gigajoule => (_value) * 1e9d,
- EnergyUnit.GigawattDay => (_value * 24 * 3600d) * 1e9d,
- EnergyUnit.GigawattHour => (_value * 3600d) * 1e9d,
- EnergyUnit.HorsepowerHour => _value * 76.0402249 * 9.80665 * 3600,
- EnergyUnit.Joule => _value,
- EnergyUnit.KilobritishThermalUnit => (_value * 1055.05585262) * 1e3d,
- EnergyUnit.Kilocalorie => (_value * 4.184) * 1e3d,
- EnergyUnit.KiloelectronVolt => (_value * 1.602176634e-19) * 1e3d,
- EnergyUnit.Kilojoule => (_value) * 1e3d,
- EnergyUnit.KilowattDay => (_value * 24 * 3600d) * 1e3d,
- EnergyUnit.KilowattHour => (_value * 3600d) * 1e3d,
- EnergyUnit.MegabritishThermalUnit => (_value * 1055.05585262) * 1e6d,
- EnergyUnit.Megacalorie => (_value * 4.184) * 1e6d,
- EnergyUnit.MegaelectronVolt => (_value * 1.602176634e-19) * 1e6d,
- EnergyUnit.Megajoule => (_value) * 1e6d,
- EnergyUnit.MegawattDay => (_value * 24 * 3600d) * 1e6d,
- EnergyUnit.MegawattHour => (_value * 3600d) * 1e6d,
- EnergyUnit.Microjoule => (_value) * 1e-6d,
- EnergyUnit.Millijoule => (_value) * 1e-3d,
- EnergyUnit.Nanojoule => (_value) * 1e-9d,
- EnergyUnit.Petajoule => (_value) * 1e15d,
- EnergyUnit.TeraelectronVolt => (_value * 1.602176634e-19) * 1e12d,
- EnergyUnit.Terajoule => (_value) * 1e12d,
- EnergyUnit.TerawattDay => (_value * 24 * 3600d) * 1e12d,
- EnergyUnit.TerawattHour => (_value * 3600d) * 1e12d,
- EnergyUnit.ThermEc => _value * 1.05505585262e8,
- EnergyUnit.ThermImperial => _value * 1.05505585257348e8,
- EnergyUnit.ThermUs => _value * 1.054804e8,
- EnergyUnit.WattDay => _value * 24 * 3600d,
- EnergyUnit.WattHour => _value * 3600d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(EnergyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- EnergyUnit.BritishThermalUnit => baseUnitValue / 1055.05585262,
- EnergyUnit.Calorie => baseUnitValue / 4.184,
- EnergyUnit.DecathermEc => (baseUnitValue / 1.05505585262e8) / 1e1d,
- EnergyUnit.DecathermImperial => (baseUnitValue / 1.05505585257348e8) / 1e1d,
- EnergyUnit.DecathermUs => (baseUnitValue / 1.054804e8) / 1e1d,
- EnergyUnit.ElectronVolt => baseUnitValue / 1.602176634e-19,
- EnergyUnit.Erg => baseUnitValue / 1e-7,
- EnergyUnit.FootPound => baseUnitValue / 1.3558179483314004,
- EnergyUnit.GigabritishThermalUnit => (baseUnitValue / 1055.05585262) / 1e9d,
- EnergyUnit.GigaelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e9d,
- EnergyUnit.Gigajoule => (baseUnitValue) / 1e9d,
- EnergyUnit.GigawattDay => (baseUnitValue / (24 * 3600d)) / 1e9d,
- EnergyUnit.GigawattHour => (baseUnitValue / 3600d) / 1e9d,
- EnergyUnit.HorsepowerHour => baseUnitValue / (76.0402249 * 9.80665 * 3600),
- EnergyUnit.Joule => baseUnitValue,
- EnergyUnit.KilobritishThermalUnit => (baseUnitValue / 1055.05585262) / 1e3d,
- EnergyUnit.Kilocalorie => (baseUnitValue / 4.184) / 1e3d,
- EnergyUnit.KiloelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e3d,
- EnergyUnit.Kilojoule => (baseUnitValue) / 1e3d,
- EnergyUnit.KilowattDay => (baseUnitValue / (24 * 3600d)) / 1e3d,
- EnergyUnit.KilowattHour => (baseUnitValue / 3600d) / 1e3d,
- EnergyUnit.MegabritishThermalUnit => (baseUnitValue / 1055.05585262) / 1e6d,
- EnergyUnit.Megacalorie => (baseUnitValue / 4.184) / 1e6d,
- EnergyUnit.MegaelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e6d,
- EnergyUnit.Megajoule => (baseUnitValue) / 1e6d,
- EnergyUnit.MegawattDay => (baseUnitValue / (24 * 3600d)) / 1e6d,
- EnergyUnit.MegawattHour => (baseUnitValue / 3600d) / 1e6d,
- EnergyUnit.Microjoule => (baseUnitValue) / 1e-6d,
- EnergyUnit.Millijoule => (baseUnitValue) / 1e-3d,
- EnergyUnit.Nanojoule => (baseUnitValue) / 1e-9d,
- EnergyUnit.Petajoule => (baseUnitValue) / 1e15d,
- EnergyUnit.TeraelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e12d,
- EnergyUnit.Terajoule => (baseUnitValue) / 1e12d,
- EnergyUnit.TerawattDay => (baseUnitValue / (24 * 3600d)) / 1e12d,
- EnergyUnit.TerawattHour => (baseUnitValue / 3600d) / 1e12d,
- EnergyUnit.ThermEc => baseUnitValue / 1.05505585262e8,
- EnergyUnit.ThermImperial => baseUnitValue / 1.05505585257348e8,
- EnergyUnit.ThermUs => baseUnitValue / 1.054804e8,
- EnergyUnit.WattDay => baseUnitValue / (24 * 3600d),
- EnergyUnit.WattHour => baseUnitValue / 3600d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(EnergyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Energy to another Energy with the unit representation .
+ ///
+ /// A Energy with the specified unit.
+ public Energy ToUnit(EnergyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Energy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ EnergyUnit.BritishThermalUnit => _value * 1055.05585262,
+ EnergyUnit.Calorie => _value * 4.184,
+ EnergyUnit.DecathermEc => (_value * 1.05505585262e8) * 1e1d,
+ EnergyUnit.DecathermImperial => (_value * 1.05505585257348e8) * 1e1d,
+ EnergyUnit.DecathermUs => (_value * 1.054804e8) * 1e1d,
+ EnergyUnit.ElectronVolt => _value * 1.602176634e-19,
+ EnergyUnit.Erg => _value * 1e-7,
+ EnergyUnit.FootPound => _value * 1.3558179483314004,
+ EnergyUnit.GigabritishThermalUnit => (_value * 1055.05585262) * 1e9d,
+ EnergyUnit.GigaelectronVolt => (_value * 1.602176634e-19) * 1e9d,
+ EnergyUnit.Gigajoule => (_value) * 1e9d,
+ EnergyUnit.GigawattDay => (_value * 24 * 3600d) * 1e9d,
+ EnergyUnit.GigawattHour => (_value * 3600d) * 1e9d,
+ EnergyUnit.HorsepowerHour => _value * 76.0402249 * 9.80665 * 3600,
+ EnergyUnit.Joule => _value,
+ EnergyUnit.KilobritishThermalUnit => (_value * 1055.05585262) * 1e3d,
+ EnergyUnit.Kilocalorie => (_value * 4.184) * 1e3d,
+ EnergyUnit.KiloelectronVolt => (_value * 1.602176634e-19) * 1e3d,
+ EnergyUnit.Kilojoule => (_value) * 1e3d,
+ EnergyUnit.KilowattDay => (_value * 24 * 3600d) * 1e3d,
+ EnergyUnit.KilowattHour => (_value * 3600d) * 1e3d,
+ EnergyUnit.MegabritishThermalUnit => (_value * 1055.05585262) * 1e6d,
+ EnergyUnit.Megacalorie => (_value * 4.184) * 1e6d,
+ EnergyUnit.MegaelectronVolt => (_value * 1.602176634e-19) * 1e6d,
+ EnergyUnit.Megajoule => (_value) * 1e6d,
+ EnergyUnit.MegawattDay => (_value * 24 * 3600d) * 1e6d,
+ EnergyUnit.MegawattHour => (_value * 3600d) * 1e6d,
+ EnergyUnit.Microjoule => (_value) * 1e-6d,
+ EnergyUnit.Millijoule => (_value) * 1e-3d,
+ EnergyUnit.Nanojoule => (_value) * 1e-9d,
+ EnergyUnit.Petajoule => (_value) * 1e15d,
+ EnergyUnit.TeraelectronVolt => (_value * 1.602176634e-19) * 1e12d,
+ EnergyUnit.Terajoule => (_value) * 1e12d,
+ EnergyUnit.TerawattDay => (_value * 24 * 3600d) * 1e12d,
+ EnergyUnit.TerawattHour => (_value * 3600d) * 1e12d,
+ EnergyUnit.ThermEc => _value * 1.05505585262e8,
+ EnergyUnit.ThermImperial => _value * 1.05505585257348e8,
+ EnergyUnit.ThermUs => _value * 1.054804e8,
+ EnergyUnit.WattDay => _value * 24 * 3600d,
+ EnergyUnit.WattHour => _value * 3600d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(EnergyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ EnergyUnit.BritishThermalUnit => baseUnitValue / 1055.05585262,
+ EnergyUnit.Calorie => baseUnitValue / 4.184,
+ EnergyUnit.DecathermEc => (baseUnitValue / 1.05505585262e8) / 1e1d,
+ EnergyUnit.DecathermImperial => (baseUnitValue / 1.05505585257348e8) / 1e1d,
+ EnergyUnit.DecathermUs => (baseUnitValue / 1.054804e8) / 1e1d,
+ EnergyUnit.ElectronVolt => baseUnitValue / 1.602176634e-19,
+ EnergyUnit.Erg => baseUnitValue / 1e-7,
+ EnergyUnit.FootPound => baseUnitValue / 1.3558179483314004,
+ EnergyUnit.GigabritishThermalUnit => (baseUnitValue / 1055.05585262) / 1e9d,
+ EnergyUnit.GigaelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e9d,
+ EnergyUnit.Gigajoule => (baseUnitValue) / 1e9d,
+ EnergyUnit.GigawattDay => (baseUnitValue / (24 * 3600d)) / 1e9d,
+ EnergyUnit.GigawattHour => (baseUnitValue / 3600d) / 1e9d,
+ EnergyUnit.HorsepowerHour => baseUnitValue / (76.0402249 * 9.80665 * 3600),
+ EnergyUnit.Joule => baseUnitValue,
+ EnergyUnit.KilobritishThermalUnit => (baseUnitValue / 1055.05585262) / 1e3d,
+ EnergyUnit.Kilocalorie => (baseUnitValue / 4.184) / 1e3d,
+ EnergyUnit.KiloelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e3d,
+ EnergyUnit.Kilojoule => (baseUnitValue) / 1e3d,
+ EnergyUnit.KilowattDay => (baseUnitValue / (24 * 3600d)) / 1e3d,
+ EnergyUnit.KilowattHour => (baseUnitValue / 3600d) / 1e3d,
+ EnergyUnit.MegabritishThermalUnit => (baseUnitValue / 1055.05585262) / 1e6d,
+ EnergyUnit.Megacalorie => (baseUnitValue / 4.184) / 1e6d,
+ EnergyUnit.MegaelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e6d,
+ EnergyUnit.Megajoule => (baseUnitValue) / 1e6d,
+ EnergyUnit.MegawattDay => (baseUnitValue / (24 * 3600d)) / 1e6d,
+ EnergyUnit.MegawattHour => (baseUnitValue / 3600d) / 1e6d,
+ EnergyUnit.Microjoule => (baseUnitValue) / 1e-6d,
+ EnergyUnit.Millijoule => (baseUnitValue) / 1e-3d,
+ EnergyUnit.Nanojoule => (baseUnitValue) / 1e-9d,
+ EnergyUnit.Petajoule => (baseUnitValue) / 1e15d,
+ EnergyUnit.TeraelectronVolt => (baseUnitValue / 1.602176634e-19) / 1e12d,
+ EnergyUnit.Terajoule => (baseUnitValue) / 1e12d,
+ EnergyUnit.TerawattDay => (baseUnitValue / (24 * 3600d)) / 1e12d,
+ EnergyUnit.TerawattHour => (baseUnitValue / 3600d) / 1e12d,
+ EnergyUnit.ThermEc => baseUnitValue / 1.05505585262e8,
+ EnergyUnit.ThermImperial => baseUnitValue / 1.05505585257348e8,
+ EnergyUnit.ThermUs => baseUnitValue / 1.054804e8,
+ EnergyUnit.WattDay => baseUnitValue / (24 * 3600d),
+ EnergyUnit.WattHour => baseUnitValue / 3600d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/EnergyDensity.g.cs
index c9d7341693..84e05274b9 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/EnergyDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/EnergyDensity.g.cs
@@ -215,75 +215,75 @@ public static EnergyDensity From(double value, EnergyDensityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(EnergyDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this EnergyDensity to another EnergyDensity with the unit representation .
- ///
- /// A EnergyDensity with the specified unit.
- public EnergyDensity ToUnit(EnergyDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new EnergyDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- EnergyDensityUnit.GigajoulePerCubicMeter => (_value) * 1e9d,
- EnergyDensityUnit.GigawattHourPerCubicMeter => (_value * 3.6e+3) * 1e9d,
- EnergyDensityUnit.JoulePerCubicMeter => _value,
- EnergyDensityUnit.KilojoulePerCubicMeter => (_value) * 1e3d,
- EnergyDensityUnit.KilowattHourPerCubicMeter => (_value * 3.6e+3) * 1e3d,
- EnergyDensityUnit.MegajoulePerCubicMeter => (_value) * 1e6d,
- EnergyDensityUnit.MegawattHourPerCubicMeter => (_value * 3.6e+3) * 1e6d,
- EnergyDensityUnit.PetajoulePerCubicMeter => (_value) * 1e15d,
- EnergyDensityUnit.PetawattHourPerCubicMeter => (_value * 3.6e+3) * 1e15d,
- EnergyDensityUnit.TerajoulePerCubicMeter => (_value) * 1e12d,
- EnergyDensityUnit.TerawattHourPerCubicMeter => (_value * 3.6e+3) * 1e12d,
- EnergyDensityUnit.WattHourPerCubicMeter => _value * 3.6e+3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(EnergyDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- EnergyDensityUnit.GigajoulePerCubicMeter => (baseUnitValue) / 1e9d,
- EnergyDensityUnit.GigawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e9d,
- EnergyDensityUnit.JoulePerCubicMeter => baseUnitValue,
- EnergyDensityUnit.KilojoulePerCubicMeter => (baseUnitValue) / 1e3d,
- EnergyDensityUnit.KilowattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e3d,
- EnergyDensityUnit.MegajoulePerCubicMeter => (baseUnitValue) / 1e6d,
- EnergyDensityUnit.MegawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e6d,
- EnergyDensityUnit.PetajoulePerCubicMeter => (baseUnitValue) / 1e15d,
- EnergyDensityUnit.PetawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e15d,
- EnergyDensityUnit.TerajoulePerCubicMeter => (baseUnitValue) / 1e12d,
- EnergyDensityUnit.TerawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e12d,
- EnergyDensityUnit.WattHourPerCubicMeter => baseUnitValue / 3.6e+3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(EnergyDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this EnergyDensity to another EnergyDensity with the unit representation .
+ ///
+ /// A EnergyDensity with the specified unit.
+ public EnergyDensity ToUnit(EnergyDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new EnergyDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ EnergyDensityUnit.GigajoulePerCubicMeter => (_value) * 1e9d,
+ EnergyDensityUnit.GigawattHourPerCubicMeter => (_value * 3.6e+3) * 1e9d,
+ EnergyDensityUnit.JoulePerCubicMeter => _value,
+ EnergyDensityUnit.KilojoulePerCubicMeter => (_value) * 1e3d,
+ EnergyDensityUnit.KilowattHourPerCubicMeter => (_value * 3.6e+3) * 1e3d,
+ EnergyDensityUnit.MegajoulePerCubicMeter => (_value) * 1e6d,
+ EnergyDensityUnit.MegawattHourPerCubicMeter => (_value * 3.6e+3) * 1e6d,
+ EnergyDensityUnit.PetajoulePerCubicMeter => (_value) * 1e15d,
+ EnergyDensityUnit.PetawattHourPerCubicMeter => (_value * 3.6e+3) * 1e15d,
+ EnergyDensityUnit.TerajoulePerCubicMeter => (_value) * 1e12d,
+ EnergyDensityUnit.TerawattHourPerCubicMeter => (_value * 3.6e+3) * 1e12d,
+ EnergyDensityUnit.WattHourPerCubicMeter => _value * 3.6e+3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(EnergyDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ EnergyDensityUnit.GigajoulePerCubicMeter => (baseUnitValue) / 1e9d,
+ EnergyDensityUnit.GigawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e9d,
+ EnergyDensityUnit.JoulePerCubicMeter => baseUnitValue,
+ EnergyDensityUnit.KilojoulePerCubicMeter => (baseUnitValue) / 1e3d,
+ EnergyDensityUnit.KilowattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e3d,
+ EnergyDensityUnit.MegajoulePerCubicMeter => (baseUnitValue) / 1e6d,
+ EnergyDensityUnit.MegawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e6d,
+ EnergyDensityUnit.PetajoulePerCubicMeter => (baseUnitValue) / 1e15d,
+ EnergyDensityUnit.PetawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e15d,
+ EnergyDensityUnit.TerajoulePerCubicMeter => (baseUnitValue) / 1e12d,
+ EnergyDensityUnit.TerawattHourPerCubicMeter => (baseUnitValue / 3.6e+3) / 1e12d,
+ EnergyDensityUnit.WattHourPerCubicMeter => baseUnitValue / 3.6e+3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Entropy.g.cs
index 69d68558db..1a5c4c773c 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Entropy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Entropy.g.cs
@@ -165,65 +165,65 @@ public static Entropy From(double value, EntropyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(EntropyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Entropy to another Entropy with the unit representation .
- ///
- /// A Entropy with the specified unit.
- public Entropy ToUnit(EntropyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Entropy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- EntropyUnit.CaloriePerKelvin => _value * 4.184,
- EntropyUnit.JoulePerDegreeCelsius => _value,
- EntropyUnit.JoulePerKelvin => _value,
- EntropyUnit.KilocaloriePerKelvin => (_value * 4.184) * 1e3d,
- EntropyUnit.KilojoulePerDegreeCelsius => (_value) * 1e3d,
- EntropyUnit.KilojoulePerKelvin => (_value) * 1e3d,
- EntropyUnit.MegajoulePerKelvin => (_value) * 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(EntropyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- EntropyUnit.CaloriePerKelvin => baseUnitValue / 4.184,
- EntropyUnit.JoulePerDegreeCelsius => baseUnitValue,
- EntropyUnit.JoulePerKelvin => baseUnitValue,
- EntropyUnit.KilocaloriePerKelvin => (baseUnitValue / 4.184) / 1e3d,
- EntropyUnit.KilojoulePerDegreeCelsius => (baseUnitValue) / 1e3d,
- EntropyUnit.KilojoulePerKelvin => (baseUnitValue) / 1e3d,
- EntropyUnit.MegajoulePerKelvin => (baseUnitValue) / 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(EntropyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Entropy to another Entropy with the unit representation .
+ ///
+ /// A Entropy with the specified unit.
+ public Entropy ToUnit(EntropyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Entropy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ EntropyUnit.CaloriePerKelvin => _value * 4.184,
+ EntropyUnit.JoulePerDegreeCelsius => _value,
+ EntropyUnit.JoulePerKelvin => _value,
+ EntropyUnit.KilocaloriePerKelvin => (_value * 4.184) * 1e3d,
+ EntropyUnit.KilojoulePerDegreeCelsius => (_value) * 1e3d,
+ EntropyUnit.KilojoulePerKelvin => (_value) * 1e3d,
+ EntropyUnit.MegajoulePerKelvin => (_value) * 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(EntropyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ EntropyUnit.CaloriePerKelvin => baseUnitValue / 4.184,
+ EntropyUnit.JoulePerDegreeCelsius => baseUnitValue,
+ EntropyUnit.JoulePerKelvin => baseUnitValue,
+ EntropyUnit.KilocaloriePerKelvin => (baseUnitValue / 4.184) / 1e3d,
+ EntropyUnit.KilojoulePerDegreeCelsius => (baseUnitValue) / 1e3d,
+ EntropyUnit.KilojoulePerKelvin => (baseUnitValue) / 1e3d,
+ EntropyUnit.MegajoulePerKelvin => (baseUnitValue) / 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/FluidResistance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/FluidResistance.g.cs
index 75aa49382e..501c1e92b1 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/FluidResistance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/FluidResistance.g.cs
@@ -288,89 +288,89 @@ public static FluidResistance From(double value, FluidResistanceUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(FluidResistanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this FluidResistance to another FluidResistance with the unit representation .
- ///
- /// A FluidResistance with the specified unit.
- public FluidResistance ToUnit(FluidResistanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new FluidResistance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- FluidResistanceUnit.DyneSecondPerCentimeterToTheFifth => _value * 1e5,
- FluidResistanceUnit.MegapascalSecondPerCubicMeter => (_value) * 1e6d,
- FluidResistanceUnit.MillimeterMercuryMinutePerCubicCentimeter => _value * 7.99934208e9,
- FluidResistanceUnit.MillimeterMercuryMinutePerCubicMeter => _value * 7.99934208e3,
- FluidResistanceUnit.MillimeterMercuryMinutePerLiter => _value * 7.99934208e6,
- FluidResistanceUnit.MillimeterMercuryMinutePerMilliliter => _value * 7.99934208e9,
- FluidResistanceUnit.MillimeterMercurySecondPerCubicCentimeter => _value * 1.33322368e8,
- FluidResistanceUnit.MillimeterMercurySecondPerCubicMeter => _value * 133.322368,
- FluidResistanceUnit.MillimeterMercurySecondPerLiter => _value * 1.33322368e5,
- FluidResistanceUnit.MillimeterMercurySecondPerMilliliter => _value * 1.33322368e8,
- FluidResistanceUnit.PascalMinutePerCubicCentimeter => _value * 6e7,
- FluidResistanceUnit.PascalMinutePerCubicMeter => _value * 60,
- FluidResistanceUnit.PascalMinutePerLiter => _value * 6e4,
- FluidResistanceUnit.PascalMinutePerMilliliter => _value * 6e7,
- FluidResistanceUnit.PascalSecondPerCubicCentimeter => _value * 1e6,
- FluidResistanceUnit.PascalSecondPerCubicMeter => _value,
- FluidResistanceUnit.PascalSecondPerLiter => _value * 1e3,
- FluidResistanceUnit.PascalSecondPerMilliliter => _value * 1e6,
- FluidResistanceUnit.WoodUnit => _value * 7.99934208e6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(FluidResistanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- FluidResistanceUnit.DyneSecondPerCentimeterToTheFifth => baseUnitValue / 1e5,
- FluidResistanceUnit.MegapascalSecondPerCubicMeter => (baseUnitValue) / 1e6d,
- FluidResistanceUnit.MillimeterMercuryMinutePerCubicCentimeter => baseUnitValue / 7.99934208e9,
- FluidResistanceUnit.MillimeterMercuryMinutePerCubicMeter => baseUnitValue / 7.99934208e3,
- FluidResistanceUnit.MillimeterMercuryMinutePerLiter => baseUnitValue / 7.99934208e6,
- FluidResistanceUnit.MillimeterMercuryMinutePerMilliliter => baseUnitValue / 7.99934208e9,
- FluidResistanceUnit.MillimeterMercurySecondPerCubicCentimeter => baseUnitValue / 1.33322368e8,
- FluidResistanceUnit.MillimeterMercurySecondPerCubicMeter => baseUnitValue / 133.322368,
- FluidResistanceUnit.MillimeterMercurySecondPerLiter => baseUnitValue / 1.33322368e5,
- FluidResistanceUnit.MillimeterMercurySecondPerMilliliter => baseUnitValue / 1.33322368e8,
- FluidResistanceUnit.PascalMinutePerCubicCentimeter => baseUnitValue / 6e7,
- FluidResistanceUnit.PascalMinutePerCubicMeter => baseUnitValue / 60,
- FluidResistanceUnit.PascalMinutePerLiter => baseUnitValue / 6e4,
- FluidResistanceUnit.PascalMinutePerMilliliter => baseUnitValue / 6e7,
- FluidResistanceUnit.PascalSecondPerCubicCentimeter => baseUnitValue / 1e6,
- FluidResistanceUnit.PascalSecondPerCubicMeter => baseUnitValue,
- FluidResistanceUnit.PascalSecondPerLiter => baseUnitValue / 1e3,
- FluidResistanceUnit.PascalSecondPerMilliliter => baseUnitValue / 1e6,
- FluidResistanceUnit.WoodUnit => baseUnitValue / 7.99934208e6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(FluidResistanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this FluidResistance to another FluidResistance with the unit representation .
+ ///
+ /// A FluidResistance with the specified unit.
+ public FluidResistance ToUnit(FluidResistanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new FluidResistance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ FluidResistanceUnit.DyneSecondPerCentimeterToTheFifth => _value * 1e5,
+ FluidResistanceUnit.MegapascalSecondPerCubicMeter => (_value) * 1e6d,
+ FluidResistanceUnit.MillimeterMercuryMinutePerCubicCentimeter => _value * 7.99934208e9,
+ FluidResistanceUnit.MillimeterMercuryMinutePerCubicMeter => _value * 7.99934208e3,
+ FluidResistanceUnit.MillimeterMercuryMinutePerLiter => _value * 7.99934208e6,
+ FluidResistanceUnit.MillimeterMercuryMinutePerMilliliter => _value * 7.99934208e9,
+ FluidResistanceUnit.MillimeterMercurySecondPerCubicCentimeter => _value * 1.33322368e8,
+ FluidResistanceUnit.MillimeterMercurySecondPerCubicMeter => _value * 133.322368,
+ FluidResistanceUnit.MillimeterMercurySecondPerLiter => _value * 1.33322368e5,
+ FluidResistanceUnit.MillimeterMercurySecondPerMilliliter => _value * 1.33322368e8,
+ FluidResistanceUnit.PascalMinutePerCubicCentimeter => _value * 6e7,
+ FluidResistanceUnit.PascalMinutePerCubicMeter => _value * 60,
+ FluidResistanceUnit.PascalMinutePerLiter => _value * 6e4,
+ FluidResistanceUnit.PascalMinutePerMilliliter => _value * 6e7,
+ FluidResistanceUnit.PascalSecondPerCubicCentimeter => _value * 1e6,
+ FluidResistanceUnit.PascalSecondPerCubicMeter => _value,
+ FluidResistanceUnit.PascalSecondPerLiter => _value * 1e3,
+ FluidResistanceUnit.PascalSecondPerMilliliter => _value * 1e6,
+ FluidResistanceUnit.WoodUnit => _value * 7.99934208e6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(FluidResistanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ FluidResistanceUnit.DyneSecondPerCentimeterToTheFifth => baseUnitValue / 1e5,
+ FluidResistanceUnit.MegapascalSecondPerCubicMeter => (baseUnitValue) / 1e6d,
+ FluidResistanceUnit.MillimeterMercuryMinutePerCubicCentimeter => baseUnitValue / 7.99934208e9,
+ FluidResistanceUnit.MillimeterMercuryMinutePerCubicMeter => baseUnitValue / 7.99934208e3,
+ FluidResistanceUnit.MillimeterMercuryMinutePerLiter => baseUnitValue / 7.99934208e6,
+ FluidResistanceUnit.MillimeterMercuryMinutePerMilliliter => baseUnitValue / 7.99934208e9,
+ FluidResistanceUnit.MillimeterMercurySecondPerCubicCentimeter => baseUnitValue / 1.33322368e8,
+ FluidResistanceUnit.MillimeterMercurySecondPerCubicMeter => baseUnitValue / 133.322368,
+ FluidResistanceUnit.MillimeterMercurySecondPerLiter => baseUnitValue / 1.33322368e5,
+ FluidResistanceUnit.MillimeterMercurySecondPerMilliliter => baseUnitValue / 1.33322368e8,
+ FluidResistanceUnit.PascalMinutePerCubicCentimeter => baseUnitValue / 6e7,
+ FluidResistanceUnit.PascalMinutePerCubicMeter => baseUnitValue / 60,
+ FluidResistanceUnit.PascalMinutePerLiter => baseUnitValue / 6e4,
+ FluidResistanceUnit.PascalMinutePerMilliliter => baseUnitValue / 6e7,
+ FluidResistanceUnit.PascalSecondPerCubicCentimeter => baseUnitValue / 1e6,
+ FluidResistanceUnit.PascalSecondPerCubicMeter => baseUnitValue,
+ FluidResistanceUnit.PascalSecondPerLiter => baseUnitValue / 1e3,
+ FluidResistanceUnit.PascalSecondPerMilliliter => baseUnitValue / 1e6,
+ FluidResistanceUnit.WoodUnit => baseUnitValue / 7.99934208e6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Force.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Force.g.cs
index 9f28f8f8d7..d09764f60c 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Force.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Force.g.cs
@@ -245,81 +245,81 @@ public static Force From(double value, ForceUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ForceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Force to another Force with the unit representation .
- ///
- /// A Force with the specified unit.
- public Force ToUnit(ForceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Force(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ForceUnit.Decanewton => (_value) * 1e1d,
- ForceUnit.Dyn => _value / 1e5,
- ForceUnit.KilogramForce => _value * 9.80665,
- ForceUnit.Kilonewton => (_value) * 1e3d,
- ForceUnit.Kilopond => _value * 9.80665,
- ForceUnit.KilopoundForce => (_value * 4.4482216152605) * 1e3d,
- ForceUnit.Meganewton => (_value) * 1e6d,
- ForceUnit.Micronewton => (_value) * 1e-6d,
- ForceUnit.Millinewton => (_value) * 1e-3d,
- ForceUnit.Newton => _value,
- ForceUnit.OunceForce => _value * (4.4482216152605 / 16),
- ForceUnit.Poundal => _value * 0.138254954376,
- ForceUnit.PoundForce => _value * 4.4482216152605,
- ForceUnit.ShortTonForce => _value * (4.4482216152605 * 2000),
- ForceUnit.TonneForce => _value * (9.80665 * 1000),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ForceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ForceUnit.Decanewton => (baseUnitValue) / 1e1d,
- ForceUnit.Dyn => baseUnitValue * 1e5,
- ForceUnit.KilogramForce => baseUnitValue / 9.80665,
- ForceUnit.Kilonewton => (baseUnitValue) / 1e3d,
- ForceUnit.Kilopond => baseUnitValue / 9.80665,
- ForceUnit.KilopoundForce => (baseUnitValue / 4.4482216152605) / 1e3d,
- ForceUnit.Meganewton => (baseUnitValue) / 1e6d,
- ForceUnit.Micronewton => (baseUnitValue) / 1e-6d,
- ForceUnit.Millinewton => (baseUnitValue) / 1e-3d,
- ForceUnit.Newton => baseUnitValue,
- ForceUnit.OunceForce => baseUnitValue / (4.4482216152605 / 16),
- ForceUnit.Poundal => baseUnitValue / 0.138254954376,
- ForceUnit.PoundForce => baseUnitValue / 4.4482216152605,
- ForceUnit.ShortTonForce => baseUnitValue / (4.4482216152605 * 2000),
- ForceUnit.TonneForce => baseUnitValue / (9.80665 * 1000),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ForceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Force to another Force with the unit representation .
+ ///
+ /// A Force with the specified unit.
+ public Force ToUnit(ForceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Force(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ForceUnit.Decanewton => (_value) * 1e1d,
+ ForceUnit.Dyn => _value / 1e5,
+ ForceUnit.KilogramForce => _value * 9.80665,
+ ForceUnit.Kilonewton => (_value) * 1e3d,
+ ForceUnit.Kilopond => _value * 9.80665,
+ ForceUnit.KilopoundForce => (_value * 4.4482216152605) * 1e3d,
+ ForceUnit.Meganewton => (_value) * 1e6d,
+ ForceUnit.Micronewton => (_value) * 1e-6d,
+ ForceUnit.Millinewton => (_value) * 1e-3d,
+ ForceUnit.Newton => _value,
+ ForceUnit.OunceForce => _value * (4.4482216152605 / 16),
+ ForceUnit.Poundal => _value * 0.138254954376,
+ ForceUnit.PoundForce => _value * 4.4482216152605,
+ ForceUnit.ShortTonForce => _value * (4.4482216152605 * 2000),
+ ForceUnit.TonneForce => _value * (9.80665 * 1000),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ForceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ForceUnit.Decanewton => (baseUnitValue) / 1e1d,
+ ForceUnit.Dyn => baseUnitValue * 1e5,
+ ForceUnit.KilogramForce => baseUnitValue / 9.80665,
+ ForceUnit.Kilonewton => (baseUnitValue) / 1e3d,
+ ForceUnit.Kilopond => baseUnitValue / 9.80665,
+ ForceUnit.KilopoundForce => (baseUnitValue / 4.4482216152605) / 1e3d,
+ ForceUnit.Meganewton => (baseUnitValue) / 1e6d,
+ ForceUnit.Micronewton => (baseUnitValue) / 1e-6d,
+ ForceUnit.Millinewton => (baseUnitValue) / 1e-3d,
+ ForceUnit.Newton => baseUnitValue,
+ ForceUnit.OunceForce => baseUnitValue / (4.4482216152605 / 16),
+ ForceUnit.Poundal => baseUnitValue / 0.138254954376,
+ ForceUnit.PoundForce => baseUnitValue / 4.4482216152605,
+ ForceUnit.ShortTonForce => baseUnitValue / (4.4482216152605 * 2000),
+ ForceUnit.TonneForce => baseUnitValue / (9.80665 * 1000),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForceChangeRate.g.cs
index 9f1a761c3c..d459748f95 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForceChangeRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForceChangeRate.g.cs
@@ -245,81 +245,81 @@ public static ForceChangeRate From(double value, ForceChangeRateUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ForceChangeRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ForceChangeRate to another ForceChangeRate with the unit representation .
- ///
- /// A ForceChangeRate with the specified unit.
- public ForceChangeRate ToUnit(ForceChangeRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ForceChangeRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ForceChangeRateUnit.CentinewtonPerSecond => (_value) * 1e-2d,
- ForceChangeRateUnit.DecanewtonPerMinute => (_value / 60) * 1e1d,
- ForceChangeRateUnit.DecanewtonPerSecond => (_value) * 1e1d,
- ForceChangeRateUnit.DecinewtonPerSecond => (_value) * 1e-1d,
- ForceChangeRateUnit.KilonewtonPerMinute => (_value / 60) * 1e3d,
- ForceChangeRateUnit.KilonewtonPerSecond => (_value) * 1e3d,
- ForceChangeRateUnit.KilopoundForcePerMinute => (_value * 4.4482216152605 / 60) * 1e3d,
- ForceChangeRateUnit.KilopoundForcePerSecond => (_value * 4.4482216152605) * 1e3d,
- ForceChangeRateUnit.MicronewtonPerSecond => (_value) * 1e-6d,
- ForceChangeRateUnit.MillinewtonPerSecond => (_value) * 1e-3d,
- ForceChangeRateUnit.NanonewtonPerSecond => (_value) * 1e-9d,
- ForceChangeRateUnit.NewtonPerMinute => _value / 60,
- ForceChangeRateUnit.NewtonPerSecond => _value,
- ForceChangeRateUnit.PoundForcePerMinute => _value * 4.4482216152605 / 60,
- ForceChangeRateUnit.PoundForcePerSecond => _value * 4.4482216152605,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ForceChangeRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ForceChangeRateUnit.CentinewtonPerSecond => (baseUnitValue) / 1e-2d,
- ForceChangeRateUnit.DecanewtonPerMinute => (baseUnitValue * 60) / 1e1d,
- ForceChangeRateUnit.DecanewtonPerSecond => (baseUnitValue) / 1e1d,
- ForceChangeRateUnit.DecinewtonPerSecond => (baseUnitValue) / 1e-1d,
- ForceChangeRateUnit.KilonewtonPerMinute => (baseUnitValue * 60) / 1e3d,
- ForceChangeRateUnit.KilonewtonPerSecond => (baseUnitValue) / 1e3d,
- ForceChangeRateUnit.KilopoundForcePerMinute => (baseUnitValue / 4.4482216152605 * 60) / 1e3d,
- ForceChangeRateUnit.KilopoundForcePerSecond => (baseUnitValue / 4.4482216152605) / 1e3d,
- ForceChangeRateUnit.MicronewtonPerSecond => (baseUnitValue) / 1e-6d,
- ForceChangeRateUnit.MillinewtonPerSecond => (baseUnitValue) / 1e-3d,
- ForceChangeRateUnit.NanonewtonPerSecond => (baseUnitValue) / 1e-9d,
- ForceChangeRateUnit.NewtonPerMinute => baseUnitValue * 60,
- ForceChangeRateUnit.NewtonPerSecond => baseUnitValue,
- ForceChangeRateUnit.PoundForcePerMinute => baseUnitValue / 4.4482216152605 * 60,
- ForceChangeRateUnit.PoundForcePerSecond => baseUnitValue / 4.4482216152605,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ForceChangeRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ForceChangeRate to another ForceChangeRate with the unit representation .
+ ///
+ /// A ForceChangeRate with the specified unit.
+ public ForceChangeRate ToUnit(ForceChangeRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ForceChangeRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ForceChangeRateUnit.CentinewtonPerSecond => (_value) * 1e-2d,
+ ForceChangeRateUnit.DecanewtonPerMinute => (_value / 60) * 1e1d,
+ ForceChangeRateUnit.DecanewtonPerSecond => (_value) * 1e1d,
+ ForceChangeRateUnit.DecinewtonPerSecond => (_value) * 1e-1d,
+ ForceChangeRateUnit.KilonewtonPerMinute => (_value / 60) * 1e3d,
+ ForceChangeRateUnit.KilonewtonPerSecond => (_value) * 1e3d,
+ ForceChangeRateUnit.KilopoundForcePerMinute => (_value * 4.4482216152605 / 60) * 1e3d,
+ ForceChangeRateUnit.KilopoundForcePerSecond => (_value * 4.4482216152605) * 1e3d,
+ ForceChangeRateUnit.MicronewtonPerSecond => (_value) * 1e-6d,
+ ForceChangeRateUnit.MillinewtonPerSecond => (_value) * 1e-3d,
+ ForceChangeRateUnit.NanonewtonPerSecond => (_value) * 1e-9d,
+ ForceChangeRateUnit.NewtonPerMinute => _value / 60,
+ ForceChangeRateUnit.NewtonPerSecond => _value,
+ ForceChangeRateUnit.PoundForcePerMinute => _value * 4.4482216152605 / 60,
+ ForceChangeRateUnit.PoundForcePerSecond => _value * 4.4482216152605,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ForceChangeRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ForceChangeRateUnit.CentinewtonPerSecond => (baseUnitValue) / 1e-2d,
+ ForceChangeRateUnit.DecanewtonPerMinute => (baseUnitValue * 60) / 1e1d,
+ ForceChangeRateUnit.DecanewtonPerSecond => (baseUnitValue) / 1e1d,
+ ForceChangeRateUnit.DecinewtonPerSecond => (baseUnitValue) / 1e-1d,
+ ForceChangeRateUnit.KilonewtonPerMinute => (baseUnitValue * 60) / 1e3d,
+ ForceChangeRateUnit.KilonewtonPerSecond => (baseUnitValue) / 1e3d,
+ ForceChangeRateUnit.KilopoundForcePerMinute => (baseUnitValue / 4.4482216152605 * 60) / 1e3d,
+ ForceChangeRateUnit.KilopoundForcePerSecond => (baseUnitValue / 4.4482216152605) / 1e3d,
+ ForceChangeRateUnit.MicronewtonPerSecond => (baseUnitValue) / 1e-6d,
+ ForceChangeRateUnit.MillinewtonPerSecond => (baseUnitValue) / 1e-3d,
+ ForceChangeRateUnit.NanonewtonPerSecond => (baseUnitValue) / 1e-9d,
+ ForceChangeRateUnit.NewtonPerMinute => baseUnitValue * 60,
+ ForceChangeRateUnit.NewtonPerSecond => baseUnitValue,
+ ForceChangeRateUnit.PoundForcePerMinute => baseUnitValue / 4.4482216152605 * 60,
+ ForceChangeRateUnit.PoundForcePerSecond => baseUnitValue / 4.4482216152605,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForcePerLength.g.cs
index f5994eafb7..2774042835 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForcePerLength.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ForcePerLength.g.cs
@@ -475,127 +475,127 @@ public static ForcePerLength From(double value, ForcePerLengthUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ForcePerLengthUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ForcePerLength to another ForcePerLength with the unit representation .
- ///
- /// A ForcePerLength with the specified unit.
- public ForcePerLength ToUnit(ForcePerLengthUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ForcePerLength(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ForcePerLengthUnit.CentinewtonPerCentimeter => (_value * 1e2) * 1e-2d,
- ForcePerLengthUnit.CentinewtonPerMeter => (_value) * 1e-2d,
- ForcePerLengthUnit.CentinewtonPerMillimeter => (_value * 1e3) * 1e-2d,
- ForcePerLengthUnit.DecanewtonPerCentimeter => (_value * 1e2) * 1e1d,
- ForcePerLengthUnit.DecanewtonPerMeter => (_value) * 1e1d,
- ForcePerLengthUnit.DecanewtonPerMillimeter => (_value * 1e3) * 1e1d,
- ForcePerLengthUnit.DecinewtonPerCentimeter => (_value * 1e2) * 1e-1d,
- ForcePerLengthUnit.DecinewtonPerMeter => (_value) * 1e-1d,
- ForcePerLengthUnit.DecinewtonPerMillimeter => (_value * 1e3) * 1e-1d,
- ForcePerLengthUnit.KilogramForcePerCentimeter => _value * 980.665,
- ForcePerLengthUnit.KilogramForcePerMeter => _value * 9.80665,
- ForcePerLengthUnit.KilogramForcePerMillimeter => _value * 9.80665e3,
- ForcePerLengthUnit.KilonewtonPerCentimeter => (_value * 1e2) * 1e3d,
- ForcePerLengthUnit.KilonewtonPerMeter => (_value) * 1e3d,
- ForcePerLengthUnit.KilonewtonPerMillimeter => (_value * 1e3) * 1e3d,
- ForcePerLengthUnit.KilopoundForcePerFoot => _value * 4.4482216152605 / 0.3048e-3,
- ForcePerLengthUnit.KilopoundForcePerInch => _value * 4.4482216152605 / 2.54e-5,
- ForcePerLengthUnit.MeganewtonPerCentimeter => (_value * 1e2) * 1e6d,
- ForcePerLengthUnit.MeganewtonPerMeter => (_value) * 1e6d,
- ForcePerLengthUnit.MeganewtonPerMillimeter => (_value * 1e3) * 1e6d,
- ForcePerLengthUnit.MicronewtonPerCentimeter => (_value * 1e2) * 1e-6d,
- ForcePerLengthUnit.MicronewtonPerMeter => (_value) * 1e-6d,
- ForcePerLengthUnit.MicronewtonPerMillimeter => (_value * 1e3) * 1e-6d,
- ForcePerLengthUnit.MillinewtonPerCentimeter => (_value * 1e2) * 1e-3d,
- ForcePerLengthUnit.MillinewtonPerMeter => (_value) * 1e-3d,
- ForcePerLengthUnit.MillinewtonPerMillimeter => (_value * 1e3) * 1e-3d,
- ForcePerLengthUnit.NanonewtonPerCentimeter => (_value * 1e2) * 1e-9d,
- ForcePerLengthUnit.NanonewtonPerMeter => (_value) * 1e-9d,
- ForcePerLengthUnit.NanonewtonPerMillimeter => (_value * 1e3) * 1e-9d,
- ForcePerLengthUnit.NewtonPerCentimeter => _value * 1e2,
- ForcePerLengthUnit.NewtonPerMeter => _value,
- ForcePerLengthUnit.NewtonPerMillimeter => _value * 1e3,
- ForcePerLengthUnit.PoundForcePerFoot => _value * 4.4482216152605 / 0.3048,
- ForcePerLengthUnit.PoundForcePerInch => _value * 4.4482216152605 / 2.54e-2,
- ForcePerLengthUnit.PoundForcePerYard => _value * 4.4482216152605 / 0.9144,
- ForcePerLengthUnit.TonneForcePerCentimeter => _value * 9.80665e5,
- ForcePerLengthUnit.TonneForcePerMeter => _value * 9.80665e3,
- ForcePerLengthUnit.TonneForcePerMillimeter => _value * 9.80665e6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ForcePerLengthUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ForcePerLengthUnit.CentinewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-2d,
- ForcePerLengthUnit.CentinewtonPerMeter => (baseUnitValue) / 1e-2d,
- ForcePerLengthUnit.CentinewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-2d,
- ForcePerLengthUnit.DecanewtonPerCentimeter => (baseUnitValue / 1e2) / 1e1d,
- ForcePerLengthUnit.DecanewtonPerMeter => (baseUnitValue) / 1e1d,
- ForcePerLengthUnit.DecanewtonPerMillimeter => (baseUnitValue / 1e3) / 1e1d,
- ForcePerLengthUnit.DecinewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-1d,
- ForcePerLengthUnit.DecinewtonPerMeter => (baseUnitValue) / 1e-1d,
- ForcePerLengthUnit.DecinewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-1d,
- ForcePerLengthUnit.KilogramForcePerCentimeter => baseUnitValue / 980.665,
- ForcePerLengthUnit.KilogramForcePerMeter => baseUnitValue / 9.80665,
- ForcePerLengthUnit.KilogramForcePerMillimeter => baseUnitValue / 9.80665e3,
- ForcePerLengthUnit.KilonewtonPerCentimeter => (baseUnitValue / 1e2) / 1e3d,
- ForcePerLengthUnit.KilonewtonPerMeter => (baseUnitValue) / 1e3d,
- ForcePerLengthUnit.KilonewtonPerMillimeter => (baseUnitValue / 1e3) / 1e3d,
- ForcePerLengthUnit.KilopoundForcePerFoot => baseUnitValue * 0.3048e-3 / 4.4482216152605,
- ForcePerLengthUnit.KilopoundForcePerInch => baseUnitValue * 2.54e-5 / 4.4482216152605,
- ForcePerLengthUnit.MeganewtonPerCentimeter => (baseUnitValue / 1e2) / 1e6d,
- ForcePerLengthUnit.MeganewtonPerMeter => (baseUnitValue) / 1e6d,
- ForcePerLengthUnit.MeganewtonPerMillimeter => (baseUnitValue / 1e3) / 1e6d,
- ForcePerLengthUnit.MicronewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-6d,
- ForcePerLengthUnit.MicronewtonPerMeter => (baseUnitValue) / 1e-6d,
- ForcePerLengthUnit.MicronewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-6d,
- ForcePerLengthUnit.MillinewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-3d,
- ForcePerLengthUnit.MillinewtonPerMeter => (baseUnitValue) / 1e-3d,
- ForcePerLengthUnit.MillinewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-3d,
- ForcePerLengthUnit.NanonewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-9d,
- ForcePerLengthUnit.NanonewtonPerMeter => (baseUnitValue) / 1e-9d,
- ForcePerLengthUnit.NanonewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-9d,
- ForcePerLengthUnit.NewtonPerCentimeter => baseUnitValue / 1e2,
- ForcePerLengthUnit.NewtonPerMeter => baseUnitValue,
- ForcePerLengthUnit.NewtonPerMillimeter => baseUnitValue / 1e3,
- ForcePerLengthUnit.PoundForcePerFoot => baseUnitValue * 0.3048 / 4.4482216152605,
- ForcePerLengthUnit.PoundForcePerInch => baseUnitValue * 2.54e-2 / 4.4482216152605,
- ForcePerLengthUnit.PoundForcePerYard => baseUnitValue * 0.9144 / 4.4482216152605,
- ForcePerLengthUnit.TonneForcePerCentimeter => baseUnitValue / 9.80665e5,
- ForcePerLengthUnit.TonneForcePerMeter => baseUnitValue / 9.80665e3,
- ForcePerLengthUnit.TonneForcePerMillimeter => baseUnitValue / 9.80665e6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ForcePerLengthUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ForcePerLength to another ForcePerLength with the unit representation .
+ ///
+ /// A ForcePerLength with the specified unit.
+ public ForcePerLength ToUnit(ForcePerLengthUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ForcePerLength(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ForcePerLengthUnit.CentinewtonPerCentimeter => (_value * 1e2) * 1e-2d,
+ ForcePerLengthUnit.CentinewtonPerMeter => (_value) * 1e-2d,
+ ForcePerLengthUnit.CentinewtonPerMillimeter => (_value * 1e3) * 1e-2d,
+ ForcePerLengthUnit.DecanewtonPerCentimeter => (_value * 1e2) * 1e1d,
+ ForcePerLengthUnit.DecanewtonPerMeter => (_value) * 1e1d,
+ ForcePerLengthUnit.DecanewtonPerMillimeter => (_value * 1e3) * 1e1d,
+ ForcePerLengthUnit.DecinewtonPerCentimeter => (_value * 1e2) * 1e-1d,
+ ForcePerLengthUnit.DecinewtonPerMeter => (_value) * 1e-1d,
+ ForcePerLengthUnit.DecinewtonPerMillimeter => (_value * 1e3) * 1e-1d,
+ ForcePerLengthUnit.KilogramForcePerCentimeter => _value * 980.665,
+ ForcePerLengthUnit.KilogramForcePerMeter => _value * 9.80665,
+ ForcePerLengthUnit.KilogramForcePerMillimeter => _value * 9.80665e3,
+ ForcePerLengthUnit.KilonewtonPerCentimeter => (_value * 1e2) * 1e3d,
+ ForcePerLengthUnit.KilonewtonPerMeter => (_value) * 1e3d,
+ ForcePerLengthUnit.KilonewtonPerMillimeter => (_value * 1e3) * 1e3d,
+ ForcePerLengthUnit.KilopoundForcePerFoot => _value * 4.4482216152605 / 0.3048e-3,
+ ForcePerLengthUnit.KilopoundForcePerInch => _value * 4.4482216152605 / 2.54e-5,
+ ForcePerLengthUnit.MeganewtonPerCentimeter => (_value * 1e2) * 1e6d,
+ ForcePerLengthUnit.MeganewtonPerMeter => (_value) * 1e6d,
+ ForcePerLengthUnit.MeganewtonPerMillimeter => (_value * 1e3) * 1e6d,
+ ForcePerLengthUnit.MicronewtonPerCentimeter => (_value * 1e2) * 1e-6d,
+ ForcePerLengthUnit.MicronewtonPerMeter => (_value) * 1e-6d,
+ ForcePerLengthUnit.MicronewtonPerMillimeter => (_value * 1e3) * 1e-6d,
+ ForcePerLengthUnit.MillinewtonPerCentimeter => (_value * 1e2) * 1e-3d,
+ ForcePerLengthUnit.MillinewtonPerMeter => (_value) * 1e-3d,
+ ForcePerLengthUnit.MillinewtonPerMillimeter => (_value * 1e3) * 1e-3d,
+ ForcePerLengthUnit.NanonewtonPerCentimeter => (_value * 1e2) * 1e-9d,
+ ForcePerLengthUnit.NanonewtonPerMeter => (_value) * 1e-9d,
+ ForcePerLengthUnit.NanonewtonPerMillimeter => (_value * 1e3) * 1e-9d,
+ ForcePerLengthUnit.NewtonPerCentimeter => _value * 1e2,
+ ForcePerLengthUnit.NewtonPerMeter => _value,
+ ForcePerLengthUnit.NewtonPerMillimeter => _value * 1e3,
+ ForcePerLengthUnit.PoundForcePerFoot => _value * 4.4482216152605 / 0.3048,
+ ForcePerLengthUnit.PoundForcePerInch => _value * 4.4482216152605 / 2.54e-2,
+ ForcePerLengthUnit.PoundForcePerYard => _value * 4.4482216152605 / 0.9144,
+ ForcePerLengthUnit.TonneForcePerCentimeter => _value * 9.80665e5,
+ ForcePerLengthUnit.TonneForcePerMeter => _value * 9.80665e3,
+ ForcePerLengthUnit.TonneForcePerMillimeter => _value * 9.80665e6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ForcePerLengthUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ForcePerLengthUnit.CentinewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-2d,
+ ForcePerLengthUnit.CentinewtonPerMeter => (baseUnitValue) / 1e-2d,
+ ForcePerLengthUnit.CentinewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-2d,
+ ForcePerLengthUnit.DecanewtonPerCentimeter => (baseUnitValue / 1e2) / 1e1d,
+ ForcePerLengthUnit.DecanewtonPerMeter => (baseUnitValue) / 1e1d,
+ ForcePerLengthUnit.DecanewtonPerMillimeter => (baseUnitValue / 1e3) / 1e1d,
+ ForcePerLengthUnit.DecinewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-1d,
+ ForcePerLengthUnit.DecinewtonPerMeter => (baseUnitValue) / 1e-1d,
+ ForcePerLengthUnit.DecinewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-1d,
+ ForcePerLengthUnit.KilogramForcePerCentimeter => baseUnitValue / 980.665,
+ ForcePerLengthUnit.KilogramForcePerMeter => baseUnitValue / 9.80665,
+ ForcePerLengthUnit.KilogramForcePerMillimeter => baseUnitValue / 9.80665e3,
+ ForcePerLengthUnit.KilonewtonPerCentimeter => (baseUnitValue / 1e2) / 1e3d,
+ ForcePerLengthUnit.KilonewtonPerMeter => (baseUnitValue) / 1e3d,
+ ForcePerLengthUnit.KilonewtonPerMillimeter => (baseUnitValue / 1e3) / 1e3d,
+ ForcePerLengthUnit.KilopoundForcePerFoot => baseUnitValue * 0.3048e-3 / 4.4482216152605,
+ ForcePerLengthUnit.KilopoundForcePerInch => baseUnitValue * 2.54e-5 / 4.4482216152605,
+ ForcePerLengthUnit.MeganewtonPerCentimeter => (baseUnitValue / 1e2) / 1e6d,
+ ForcePerLengthUnit.MeganewtonPerMeter => (baseUnitValue) / 1e6d,
+ ForcePerLengthUnit.MeganewtonPerMillimeter => (baseUnitValue / 1e3) / 1e6d,
+ ForcePerLengthUnit.MicronewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-6d,
+ ForcePerLengthUnit.MicronewtonPerMeter => (baseUnitValue) / 1e-6d,
+ ForcePerLengthUnit.MicronewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-6d,
+ ForcePerLengthUnit.MillinewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-3d,
+ ForcePerLengthUnit.MillinewtonPerMeter => (baseUnitValue) / 1e-3d,
+ ForcePerLengthUnit.MillinewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-3d,
+ ForcePerLengthUnit.NanonewtonPerCentimeter => (baseUnitValue / 1e2) / 1e-9d,
+ ForcePerLengthUnit.NanonewtonPerMeter => (baseUnitValue) / 1e-9d,
+ ForcePerLengthUnit.NanonewtonPerMillimeter => (baseUnitValue / 1e3) / 1e-9d,
+ ForcePerLengthUnit.NewtonPerCentimeter => baseUnitValue / 1e2,
+ ForcePerLengthUnit.NewtonPerMeter => baseUnitValue,
+ ForcePerLengthUnit.NewtonPerMillimeter => baseUnitValue / 1e3,
+ ForcePerLengthUnit.PoundForcePerFoot => baseUnitValue * 0.3048 / 4.4482216152605,
+ ForcePerLengthUnit.PoundForcePerInch => baseUnitValue * 2.54e-2 / 4.4482216152605,
+ ForcePerLengthUnit.PoundForcePerYard => baseUnitValue * 0.9144 / 4.4482216152605,
+ ForcePerLengthUnit.TonneForcePerCentimeter => baseUnitValue / 9.80665e5,
+ ForcePerLengthUnit.TonneForcePerMeter => baseUnitValue / 9.80665e3,
+ ForcePerLengthUnit.TonneForcePerMillimeter => baseUnitValue / 9.80665e6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Frequency.g.cs
index 10ab65d3b0..40288fd557 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Frequency.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Frequency.g.cs
@@ -215,75 +215,75 @@ public static Frequency From(double value, FrequencyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(FrequencyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Frequency to another Frequency with the unit representation .
- ///
- /// A Frequency with the specified unit.
- public Frequency ToUnit(FrequencyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Frequency(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- FrequencyUnit.BeatPerMinute => _value / 60,
- FrequencyUnit.CyclePerHour => _value / 3600,
- FrequencyUnit.CyclePerMinute => _value / 60,
- FrequencyUnit.Gigahertz => (_value) * 1e9d,
- FrequencyUnit.Hertz => _value,
- FrequencyUnit.Kilohertz => (_value) * 1e3d,
- FrequencyUnit.Megahertz => (_value) * 1e6d,
- FrequencyUnit.Microhertz => (_value) * 1e-6d,
- FrequencyUnit.Millihertz => (_value) * 1e-3d,
- FrequencyUnit.PerSecond => _value,
- FrequencyUnit.RadianPerSecond => _value / (2 * 3.1415926535897931),
- FrequencyUnit.Terahertz => (_value) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(FrequencyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- FrequencyUnit.BeatPerMinute => baseUnitValue * 60,
- FrequencyUnit.CyclePerHour => baseUnitValue * 3600,
- FrequencyUnit.CyclePerMinute => baseUnitValue * 60,
- FrequencyUnit.Gigahertz => (baseUnitValue) / 1e9d,
- FrequencyUnit.Hertz => baseUnitValue,
- FrequencyUnit.Kilohertz => (baseUnitValue) / 1e3d,
- FrequencyUnit.Megahertz => (baseUnitValue) / 1e6d,
- FrequencyUnit.Microhertz => (baseUnitValue) / 1e-6d,
- FrequencyUnit.Millihertz => (baseUnitValue) / 1e-3d,
- FrequencyUnit.PerSecond => baseUnitValue,
- FrequencyUnit.RadianPerSecond => baseUnitValue * (2 * 3.1415926535897931),
- FrequencyUnit.Terahertz => (baseUnitValue) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(FrequencyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Frequency to another Frequency with the unit representation .
+ ///
+ /// A Frequency with the specified unit.
+ public Frequency ToUnit(FrequencyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Frequency(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ FrequencyUnit.BeatPerMinute => _value / 60,
+ FrequencyUnit.CyclePerHour => _value / 3600,
+ FrequencyUnit.CyclePerMinute => _value / 60,
+ FrequencyUnit.Gigahertz => (_value) * 1e9d,
+ FrequencyUnit.Hertz => _value,
+ FrequencyUnit.Kilohertz => (_value) * 1e3d,
+ FrequencyUnit.Megahertz => (_value) * 1e6d,
+ FrequencyUnit.Microhertz => (_value) * 1e-6d,
+ FrequencyUnit.Millihertz => (_value) * 1e-3d,
+ FrequencyUnit.PerSecond => _value,
+ FrequencyUnit.RadianPerSecond => _value / (2 * 3.1415926535897931),
+ FrequencyUnit.Terahertz => (_value) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(FrequencyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ FrequencyUnit.BeatPerMinute => baseUnitValue * 60,
+ FrequencyUnit.CyclePerHour => baseUnitValue * 3600,
+ FrequencyUnit.CyclePerMinute => baseUnitValue * 60,
+ FrequencyUnit.Gigahertz => (baseUnitValue) / 1e9d,
+ FrequencyUnit.Hertz => baseUnitValue,
+ FrequencyUnit.Kilohertz => (baseUnitValue) / 1e3d,
+ FrequencyUnit.Megahertz => (baseUnitValue) / 1e6d,
+ FrequencyUnit.Microhertz => (baseUnitValue) / 1e-6d,
+ FrequencyUnit.Millihertz => (baseUnitValue) / 1e-3d,
+ FrequencyUnit.PerSecond => baseUnitValue,
+ FrequencyUnit.RadianPerSecond => baseUnitValue * (2 * 3.1415926535897931),
+ FrequencyUnit.Terahertz => (baseUnitValue) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs
index e6932b94c0..052504519b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/FuelEfficiency.g.cs
@@ -138,59 +138,59 @@ public static FuelEfficiency From(double value, FuelEfficiencyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(FuelEfficiencyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this FuelEfficiency to another FuelEfficiency with the unit representation .
- ///
- /// A FuelEfficiency with the specified unit.
- public FuelEfficiency ToUnit(FuelEfficiencyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new FuelEfficiency(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- FuelEfficiencyUnit.KilometerPerLiter => _value,
- FuelEfficiencyUnit.LiterPer100Kilometers => 100 / _value,
- FuelEfficiencyUnit.MilePerUkGallon => _value * 1.609344 / 4.54609,
- FuelEfficiencyUnit.MilePerUsGallon => _value * 1.609344 / 3.785411784,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(FuelEfficiencyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- FuelEfficiencyUnit.KilometerPerLiter => baseUnitValue,
- FuelEfficiencyUnit.LiterPer100Kilometers => 100 / baseUnitValue,
- FuelEfficiencyUnit.MilePerUkGallon => baseUnitValue * 4.54609 / 1.609344,
- FuelEfficiencyUnit.MilePerUsGallon => baseUnitValue * 3.785411784 / 1.609344,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(FuelEfficiencyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this FuelEfficiency to another FuelEfficiency with the unit representation .
+ ///
+ /// A FuelEfficiency with the specified unit.
+ public FuelEfficiency ToUnit(FuelEfficiencyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new FuelEfficiency(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ FuelEfficiencyUnit.KilometerPerLiter => _value,
+ FuelEfficiencyUnit.LiterPer100Kilometers => 100 / _value,
+ FuelEfficiencyUnit.MilePerUkGallon => _value * 1.609344 / 4.54609,
+ FuelEfficiencyUnit.MilePerUsGallon => _value * 1.609344 / 3.785411784,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(FuelEfficiencyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ FuelEfficiencyUnit.KilometerPerLiter => baseUnitValue,
+ FuelEfficiencyUnit.LiterPer100Kilometers => 100 / baseUnitValue,
+ FuelEfficiencyUnit.MilePerUkGallon => baseUnitValue * 4.54609 / 1.609344,
+ FuelEfficiencyUnit.MilePerUsGallon => baseUnitValue * 3.785411784 / 1.609344,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatFlux.g.cs
index d1027cafde..749cb7f90e 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatFlux.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatFlux.g.cs
@@ -275,87 +275,87 @@ public static HeatFlux From(double value, HeatFluxUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(HeatFluxUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this HeatFlux to another HeatFlux with the unit representation .
- ///
- /// A HeatFlux with the specified unit.
- public HeatFlux ToUnit(HeatFluxUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new HeatFlux(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- HeatFluxUnit.BtuPerHourSquareFoot => _value * 1055.05585262 / (0.3048 * 0.3048 * 3600),
- HeatFluxUnit.BtuPerMinuteSquareFoot => _value * 1055.05585262 / (0.3048 * 0.3048 * 60),
- HeatFluxUnit.BtuPerSecondSquareFoot => _value * 1055.05585262 / (0.3048 * 0.3048),
- HeatFluxUnit.BtuPerSecondSquareInch => _value * 1055.05585262 / (2.54e-2 * 2.54e-2),
- HeatFluxUnit.CaloriePerSecondSquareCentimeter => _value * 4.184e4,
- HeatFluxUnit.CentiwattPerSquareMeter => (_value) * 1e-2d,
- HeatFluxUnit.DeciwattPerSquareMeter => (_value) * 1e-1d,
- HeatFluxUnit.KilocaloriePerHourSquareMeter => _value * 4.184e3 / 3600,
- HeatFluxUnit.KilocaloriePerSecondSquareCentimeter => (_value * 4.184e4) * 1e3d,
- HeatFluxUnit.KilowattPerSquareMeter => (_value) * 1e3d,
- HeatFluxUnit.MicrowattPerSquareMeter => (_value) * 1e-6d,
- HeatFluxUnit.MilliwattPerSquareMeter => (_value) * 1e-3d,
- HeatFluxUnit.NanowattPerSquareMeter => (_value) * 1e-9d,
- HeatFluxUnit.PoundForcePerFootSecond => _value * 1.3558179483314004 / 9.290304e-2,
- HeatFluxUnit.PoundPerSecondCubed => _value * 4.5359237e-1,
- HeatFluxUnit.WattPerSquareFoot => _value / (0.3048 * 0.3048),
- HeatFluxUnit.WattPerSquareInch => _value / (2.54e-2 * 2.54e-2),
- HeatFluxUnit.WattPerSquareMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(HeatFluxUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- HeatFluxUnit.BtuPerHourSquareFoot => baseUnitValue * (0.3048 * 0.3048 * 3600) / 1055.05585262,
- HeatFluxUnit.BtuPerMinuteSquareFoot => baseUnitValue * (0.3048 * 0.3048 * 60) / 1055.05585262,
- HeatFluxUnit.BtuPerSecondSquareFoot => baseUnitValue * (0.3048 * 0.3048) / 1055.05585262,
- HeatFluxUnit.BtuPerSecondSquareInch => baseUnitValue * (2.54e-2 * 2.54e-2) / 1055.05585262,
- HeatFluxUnit.CaloriePerSecondSquareCentimeter => baseUnitValue / 4.184e4,
- HeatFluxUnit.CentiwattPerSquareMeter => (baseUnitValue) / 1e-2d,
- HeatFluxUnit.DeciwattPerSquareMeter => (baseUnitValue) / 1e-1d,
- HeatFluxUnit.KilocaloriePerHourSquareMeter => baseUnitValue * 3600 / 4.184e3,
- HeatFluxUnit.KilocaloriePerSecondSquareCentimeter => (baseUnitValue / 4.184e4) / 1e3d,
- HeatFluxUnit.KilowattPerSquareMeter => (baseUnitValue) / 1e3d,
- HeatFluxUnit.MicrowattPerSquareMeter => (baseUnitValue) / 1e-6d,
- HeatFluxUnit.MilliwattPerSquareMeter => (baseUnitValue) / 1e-3d,
- HeatFluxUnit.NanowattPerSquareMeter => (baseUnitValue) / 1e-9d,
- HeatFluxUnit.PoundForcePerFootSecond => baseUnitValue * 9.290304e-2 / 1.3558179483314004,
- HeatFluxUnit.PoundPerSecondCubed => baseUnitValue / 4.5359237e-1,
- HeatFluxUnit.WattPerSquareFoot => baseUnitValue * (0.3048 * 0.3048),
- HeatFluxUnit.WattPerSquareInch => baseUnitValue * (2.54e-2 * 2.54e-2),
- HeatFluxUnit.WattPerSquareMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(HeatFluxUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this HeatFlux to another HeatFlux with the unit representation .
+ ///
+ /// A HeatFlux with the specified unit.
+ public HeatFlux ToUnit(HeatFluxUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new HeatFlux(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ HeatFluxUnit.BtuPerHourSquareFoot => _value * 1055.05585262 / (0.3048 * 0.3048 * 3600),
+ HeatFluxUnit.BtuPerMinuteSquareFoot => _value * 1055.05585262 / (0.3048 * 0.3048 * 60),
+ HeatFluxUnit.BtuPerSecondSquareFoot => _value * 1055.05585262 / (0.3048 * 0.3048),
+ HeatFluxUnit.BtuPerSecondSquareInch => _value * 1055.05585262 / (2.54e-2 * 2.54e-2),
+ HeatFluxUnit.CaloriePerSecondSquareCentimeter => _value * 4.184e4,
+ HeatFluxUnit.CentiwattPerSquareMeter => (_value) * 1e-2d,
+ HeatFluxUnit.DeciwattPerSquareMeter => (_value) * 1e-1d,
+ HeatFluxUnit.KilocaloriePerHourSquareMeter => _value * 4.184e3 / 3600,
+ HeatFluxUnit.KilocaloriePerSecondSquareCentimeter => (_value * 4.184e4) * 1e3d,
+ HeatFluxUnit.KilowattPerSquareMeter => (_value) * 1e3d,
+ HeatFluxUnit.MicrowattPerSquareMeter => (_value) * 1e-6d,
+ HeatFluxUnit.MilliwattPerSquareMeter => (_value) * 1e-3d,
+ HeatFluxUnit.NanowattPerSquareMeter => (_value) * 1e-9d,
+ HeatFluxUnit.PoundForcePerFootSecond => _value * 1.3558179483314004 / 9.290304e-2,
+ HeatFluxUnit.PoundPerSecondCubed => _value * 4.5359237e-1,
+ HeatFluxUnit.WattPerSquareFoot => _value / (0.3048 * 0.3048),
+ HeatFluxUnit.WattPerSquareInch => _value / (2.54e-2 * 2.54e-2),
+ HeatFluxUnit.WattPerSquareMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(HeatFluxUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ HeatFluxUnit.BtuPerHourSquareFoot => baseUnitValue * (0.3048 * 0.3048 * 3600) / 1055.05585262,
+ HeatFluxUnit.BtuPerMinuteSquareFoot => baseUnitValue * (0.3048 * 0.3048 * 60) / 1055.05585262,
+ HeatFluxUnit.BtuPerSecondSquareFoot => baseUnitValue * (0.3048 * 0.3048) / 1055.05585262,
+ HeatFluxUnit.BtuPerSecondSquareInch => baseUnitValue * (2.54e-2 * 2.54e-2) / 1055.05585262,
+ HeatFluxUnit.CaloriePerSecondSquareCentimeter => baseUnitValue / 4.184e4,
+ HeatFluxUnit.CentiwattPerSquareMeter => (baseUnitValue) / 1e-2d,
+ HeatFluxUnit.DeciwattPerSquareMeter => (baseUnitValue) / 1e-1d,
+ HeatFluxUnit.KilocaloriePerHourSquareMeter => baseUnitValue * 3600 / 4.184e3,
+ HeatFluxUnit.KilocaloriePerSecondSquareCentimeter => (baseUnitValue / 4.184e4) / 1e3d,
+ HeatFluxUnit.KilowattPerSquareMeter => (baseUnitValue) / 1e3d,
+ HeatFluxUnit.MicrowattPerSquareMeter => (baseUnitValue) / 1e-6d,
+ HeatFluxUnit.MilliwattPerSquareMeter => (baseUnitValue) / 1e-3d,
+ HeatFluxUnit.NanowattPerSquareMeter => (baseUnitValue) / 1e-9d,
+ HeatFluxUnit.PoundForcePerFootSecond => baseUnitValue * 9.290304e-2 / 1.3558179483314004,
+ HeatFluxUnit.PoundPerSecondCubed => baseUnitValue / 4.5359237e-1,
+ HeatFluxUnit.WattPerSquareFoot => baseUnitValue * (0.3048 * 0.3048),
+ HeatFluxUnit.WattPerSquareInch => baseUnitValue * (2.54e-2 * 2.54e-2),
+ HeatFluxUnit.WattPerSquareMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs
index 274c8b4cec..5cfe2ec421 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs
@@ -145,61 +145,61 @@ public static HeatTransferCoefficient From(double value, HeatTransferCoefficient
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(HeatTransferCoefficientUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this HeatTransferCoefficient to another HeatTransferCoefficient with the unit representation .
- ///
- /// A HeatTransferCoefficient with the specified unit.
- public HeatTransferCoefficient ToUnit(HeatTransferCoefficientUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new HeatTransferCoefficient(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => _value * ((1055.05585262 / (0.3048 * 0.3048 * 3600)) * 1.8),
- HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (_value * 4.184) / 3600,
- HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => ((_value * 4.184) / 3600) * 1e3d,
- HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => _value,
- HeatTransferCoefficientUnit.WattPerSquareMeterKelvin => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(HeatTransferCoefficientUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => baseUnitValue / ((1055.05585262 / (0.3048 * 0.3048 * 3600)) * 1.8),
- HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (baseUnitValue / 4.184) * 3600,
- HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => ((baseUnitValue / 4.184) * 3600) / 1e3d,
- HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => baseUnitValue,
- HeatTransferCoefficientUnit.WattPerSquareMeterKelvin => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(HeatTransferCoefficientUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this HeatTransferCoefficient to another HeatTransferCoefficient with the unit representation .
+ ///
+ /// A HeatTransferCoefficient with the specified unit.
+ public HeatTransferCoefficient ToUnit(HeatTransferCoefficientUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new HeatTransferCoefficient(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => _value * ((1055.05585262 / (0.3048 * 0.3048 * 3600)) * 1.8),
+ HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (_value * 4.184) / 3600,
+ HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => ((_value * 4.184) / 3600) * 1e3d,
+ HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => _value,
+ HeatTransferCoefficientUnit.WattPerSquareMeterKelvin => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(HeatTransferCoefficientUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ HeatTransferCoefficientUnit.BtuPerHourSquareFootDegreeFahrenheit => baseUnitValue / ((1055.05585262 / (0.3048 * 0.3048 * 3600)) * 1.8),
+ HeatTransferCoefficientUnit.CaloriePerHourSquareMeterDegreeCelsius => (baseUnitValue / 4.184) * 3600,
+ HeatTransferCoefficientUnit.KilocaloriePerHourSquareMeterDegreeCelsius => ((baseUnitValue / 4.184) * 3600) / 1e3d,
+ HeatTransferCoefficientUnit.WattPerSquareMeterCelsius => baseUnitValue,
+ HeatTransferCoefficientUnit.WattPerSquareMeterKelvin => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Illuminance.g.cs
index 6fda4ca9d3..7aa1150959 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Illuminance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Illuminance.g.cs
@@ -138,59 +138,59 @@ public static Illuminance From(double value, IlluminanceUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(IlluminanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Illuminance to another Illuminance with the unit representation .
- ///
- /// A Illuminance with the specified unit.
- public Illuminance ToUnit(IlluminanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Illuminance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- IlluminanceUnit.Kilolux => (_value) * 1e3d,
- IlluminanceUnit.Lux => _value,
- IlluminanceUnit.Megalux => (_value) * 1e6d,
- IlluminanceUnit.Millilux => (_value) * 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(IlluminanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- IlluminanceUnit.Kilolux => (baseUnitValue) / 1e3d,
- IlluminanceUnit.Lux => baseUnitValue,
- IlluminanceUnit.Megalux => (baseUnitValue) / 1e6d,
- IlluminanceUnit.Millilux => (baseUnitValue) / 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(IlluminanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Illuminance to another Illuminance with the unit representation .
+ ///
+ /// A Illuminance with the specified unit.
+ public Illuminance ToUnit(IlluminanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Illuminance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ IlluminanceUnit.Kilolux => (_value) * 1e3d,
+ IlluminanceUnit.Lux => _value,
+ IlluminanceUnit.Megalux => (_value) * 1e6d,
+ IlluminanceUnit.Millilux => (_value) * 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(IlluminanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ IlluminanceUnit.Kilolux => (baseUnitValue) / 1e3d,
+ IlluminanceUnit.Lux => baseUnitValue,
+ IlluminanceUnit.Megalux => (baseUnitValue) / 1e6d,
+ IlluminanceUnit.Millilux => (baseUnitValue) / 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Impulse.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Impulse.g.cs
index 00b105ccb6..a870eb9b51 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Impulse.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Impulse.g.cs
@@ -225,77 +225,77 @@ public static Impulse From(double value, ImpulseUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ImpulseUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Impulse to another Impulse with the unit representation .
- ///
- /// A Impulse with the specified unit.
- public Impulse ToUnit(ImpulseUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Impulse(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ImpulseUnit.CentinewtonSecond => (_value) * 1e-2d,
- ImpulseUnit.DecanewtonSecond => (_value) * 1e1d,
- ImpulseUnit.DecinewtonSecond => (_value) * 1e-1d,
- ImpulseUnit.KilogramMeterPerSecond => _value,
- ImpulseUnit.KilonewtonSecond => (_value) * 1e3d,
- ImpulseUnit.MeganewtonSecond => (_value) * 1e6d,
- ImpulseUnit.MicronewtonSecond => (_value) * 1e-6d,
- ImpulseUnit.MillinewtonSecond => (_value) * 1e-3d,
- ImpulseUnit.NanonewtonSecond => (_value) * 1e-9d,
- ImpulseUnit.NewtonSecond => _value,
- ImpulseUnit.PoundFootPerSecond => _value * (0.45359237 * 0.3048),
- ImpulseUnit.PoundForceSecond => _value * 0.45359237 * 9.80665,
- ImpulseUnit.SlugFootPerSecond => _value * (0.45359237 * 9.80665),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ImpulseUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ImpulseUnit.CentinewtonSecond => (baseUnitValue) / 1e-2d,
- ImpulseUnit.DecanewtonSecond => (baseUnitValue) / 1e1d,
- ImpulseUnit.DecinewtonSecond => (baseUnitValue) / 1e-1d,
- ImpulseUnit.KilogramMeterPerSecond => baseUnitValue,
- ImpulseUnit.KilonewtonSecond => (baseUnitValue) / 1e3d,
- ImpulseUnit.MeganewtonSecond => (baseUnitValue) / 1e6d,
- ImpulseUnit.MicronewtonSecond => (baseUnitValue) / 1e-6d,
- ImpulseUnit.MillinewtonSecond => (baseUnitValue) / 1e-3d,
- ImpulseUnit.NanonewtonSecond => (baseUnitValue) / 1e-9d,
- ImpulseUnit.NewtonSecond => baseUnitValue,
- ImpulseUnit.PoundFootPerSecond => baseUnitValue / (0.45359237 * 0.3048),
- ImpulseUnit.PoundForceSecond => baseUnitValue / (0.45359237 * 9.80665),
- ImpulseUnit.SlugFootPerSecond => baseUnitValue / (0.45359237 * 9.80665),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ImpulseUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Impulse to another Impulse with the unit representation .
+ ///
+ /// A Impulse with the specified unit.
+ public Impulse ToUnit(ImpulseUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Impulse(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ImpulseUnit.CentinewtonSecond => (_value) * 1e-2d,
+ ImpulseUnit.DecanewtonSecond => (_value) * 1e1d,
+ ImpulseUnit.DecinewtonSecond => (_value) * 1e-1d,
+ ImpulseUnit.KilogramMeterPerSecond => _value,
+ ImpulseUnit.KilonewtonSecond => (_value) * 1e3d,
+ ImpulseUnit.MeganewtonSecond => (_value) * 1e6d,
+ ImpulseUnit.MicronewtonSecond => (_value) * 1e-6d,
+ ImpulseUnit.MillinewtonSecond => (_value) * 1e-3d,
+ ImpulseUnit.NanonewtonSecond => (_value) * 1e-9d,
+ ImpulseUnit.NewtonSecond => _value,
+ ImpulseUnit.PoundFootPerSecond => _value * (0.45359237 * 0.3048),
+ ImpulseUnit.PoundForceSecond => _value * 0.45359237 * 9.80665,
+ ImpulseUnit.SlugFootPerSecond => _value * (0.45359237 * 9.80665),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ImpulseUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ImpulseUnit.CentinewtonSecond => (baseUnitValue) / 1e-2d,
+ ImpulseUnit.DecanewtonSecond => (baseUnitValue) / 1e1d,
+ ImpulseUnit.DecinewtonSecond => (baseUnitValue) / 1e-1d,
+ ImpulseUnit.KilogramMeterPerSecond => baseUnitValue,
+ ImpulseUnit.KilonewtonSecond => (baseUnitValue) / 1e3d,
+ ImpulseUnit.MeganewtonSecond => (baseUnitValue) / 1e6d,
+ ImpulseUnit.MicronewtonSecond => (baseUnitValue) / 1e-6d,
+ ImpulseUnit.MillinewtonSecond => (baseUnitValue) / 1e-3d,
+ ImpulseUnit.NanonewtonSecond => (baseUnitValue) / 1e-9d,
+ ImpulseUnit.NewtonSecond => baseUnitValue,
+ ImpulseUnit.PoundFootPerSecond => baseUnitValue / (0.45359237 * 0.3048),
+ ImpulseUnit.PoundForceSecond => baseUnitValue / (0.45359237 * 9.80665),
+ ImpulseUnit.SlugFootPerSecond => baseUnitValue / (0.45359237 * 9.80665),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Information.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Information.g.cs
index e40569f9e4..b3fbe600f9 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Information.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Information.g.cs
@@ -485,129 +485,129 @@ public static Information From(double value, InformationUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(InformationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Information to another Information with the unit representation .
- ///
- /// A Information with the specified unit.
- public Information ToUnit(InformationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Information(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- InformationUnit.Bit => _value,
- InformationUnit.Byte => _value * 8,
- InformationUnit.Exabit => (_value) * 1e18d,
- InformationUnit.Exabyte => (_value * 8) * 1e18d,
- InformationUnit.Exaoctet => (_value * 8) * 1e18d,
- InformationUnit.Exbibit => (_value) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Exbibyte => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Exbioctet => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Gibibit => (_value) * (1024d * 1024 * 1024),
- InformationUnit.Gibibyte => (_value * 8) * (1024d * 1024 * 1024),
- InformationUnit.Gibioctet => (_value * 8) * (1024d * 1024 * 1024),
- InformationUnit.Gigabit => (_value) * 1e9d,
- InformationUnit.Gigabyte => (_value * 8) * 1e9d,
- InformationUnit.Gigaoctet => (_value * 8) * 1e9d,
- InformationUnit.Kibibit => (_value) * 1024d,
- InformationUnit.Kibibyte => (_value * 8) * 1024d,
- InformationUnit.Kibioctet => (_value * 8) * 1024d,
- InformationUnit.Kilobit => (_value) * 1e3d,
- InformationUnit.Kilobyte => (_value * 8) * 1e3d,
- InformationUnit.Kilooctet => (_value * 8) * 1e3d,
- InformationUnit.Mebibit => (_value) * (1024d * 1024),
- InformationUnit.Mebibyte => (_value * 8) * (1024d * 1024),
- InformationUnit.Mebioctet => (_value * 8) * (1024d * 1024),
- InformationUnit.Megabit => (_value) * 1e6d,
- InformationUnit.Megabyte => (_value * 8) * 1e6d,
- InformationUnit.Megaoctet => (_value * 8) * 1e6d,
- InformationUnit.Octet => _value * 8,
- InformationUnit.Pebibit => (_value) * (1024d * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Pebibyte => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Pebioctet => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Petabit => (_value) * 1e15d,
- InformationUnit.Petabyte => (_value * 8) * 1e15d,
- InformationUnit.Petaoctet => (_value * 8) * 1e15d,
- InformationUnit.Tebibit => (_value) * (1024d * 1024 * 1024 * 1024),
- InformationUnit.Tebibyte => (_value * 8) * (1024d * 1024 * 1024 * 1024),
- InformationUnit.Tebioctet => (_value * 8) * (1024d * 1024 * 1024 * 1024),
- InformationUnit.Terabit => (_value) * 1e12d,
- InformationUnit.Terabyte => (_value * 8) * 1e12d,
- InformationUnit.Teraoctet => (_value * 8) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(InformationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- InformationUnit.Bit => baseUnitValue,
- InformationUnit.Byte => baseUnitValue / 8,
- InformationUnit.Exabit => (baseUnitValue) / 1e18d,
- InformationUnit.Exabyte => (baseUnitValue / 8) / 1e18d,
- InformationUnit.Exaoctet => (baseUnitValue / 8) / 1e18d,
- InformationUnit.Exbibit => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Exbibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Exbioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Gibibit => (baseUnitValue) / (1024d * 1024 * 1024),
- InformationUnit.Gibibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024),
- InformationUnit.Gibioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024),
- InformationUnit.Gigabit => (baseUnitValue) / 1e9d,
- InformationUnit.Gigabyte => (baseUnitValue / 8) / 1e9d,
- InformationUnit.Gigaoctet => (baseUnitValue / 8) / 1e9d,
- InformationUnit.Kibibit => (baseUnitValue) / 1024d,
- InformationUnit.Kibibyte => (baseUnitValue / 8) / 1024d,
- InformationUnit.Kibioctet => (baseUnitValue / 8) / 1024d,
- InformationUnit.Kilobit => (baseUnitValue) / 1e3d,
- InformationUnit.Kilobyte => (baseUnitValue / 8) / 1e3d,
- InformationUnit.Kilooctet => (baseUnitValue / 8) / 1e3d,
- InformationUnit.Mebibit => (baseUnitValue) / (1024d * 1024),
- InformationUnit.Mebibyte => (baseUnitValue / 8) / (1024d * 1024),
- InformationUnit.Mebioctet => (baseUnitValue / 8) / (1024d * 1024),
- InformationUnit.Megabit => (baseUnitValue) / 1e6d,
- InformationUnit.Megabyte => (baseUnitValue / 8) / 1e6d,
- InformationUnit.Megaoctet => (baseUnitValue / 8) / 1e6d,
- InformationUnit.Octet => baseUnitValue / 8,
- InformationUnit.Pebibit => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Pebibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Pebioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
- InformationUnit.Petabit => (baseUnitValue) / 1e15d,
- InformationUnit.Petabyte => (baseUnitValue / 8) / 1e15d,
- InformationUnit.Petaoctet => (baseUnitValue / 8) / 1e15d,
- InformationUnit.Tebibit => (baseUnitValue) / (1024d * 1024 * 1024 * 1024),
- InformationUnit.Tebibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
- InformationUnit.Tebioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
- InformationUnit.Terabit => (baseUnitValue) / 1e12d,
- InformationUnit.Terabyte => (baseUnitValue / 8) / 1e12d,
- InformationUnit.Teraoctet => (baseUnitValue / 8) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(InformationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Information to another Information with the unit representation .
+ ///
+ /// A Information with the specified unit.
+ public Information ToUnit(InformationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Information(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ InformationUnit.Bit => _value,
+ InformationUnit.Byte => _value * 8,
+ InformationUnit.Exabit => (_value) * 1e18d,
+ InformationUnit.Exabyte => (_value * 8) * 1e18d,
+ InformationUnit.Exaoctet => (_value * 8) * 1e18d,
+ InformationUnit.Exbibit => (_value) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Exbibyte => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Exbioctet => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Gibibit => (_value) * (1024d * 1024 * 1024),
+ InformationUnit.Gibibyte => (_value * 8) * (1024d * 1024 * 1024),
+ InformationUnit.Gibioctet => (_value * 8) * (1024d * 1024 * 1024),
+ InformationUnit.Gigabit => (_value) * 1e9d,
+ InformationUnit.Gigabyte => (_value * 8) * 1e9d,
+ InformationUnit.Gigaoctet => (_value * 8) * 1e9d,
+ InformationUnit.Kibibit => (_value) * 1024d,
+ InformationUnit.Kibibyte => (_value * 8) * 1024d,
+ InformationUnit.Kibioctet => (_value * 8) * 1024d,
+ InformationUnit.Kilobit => (_value) * 1e3d,
+ InformationUnit.Kilobyte => (_value * 8) * 1e3d,
+ InformationUnit.Kilooctet => (_value * 8) * 1e3d,
+ InformationUnit.Mebibit => (_value) * (1024d * 1024),
+ InformationUnit.Mebibyte => (_value * 8) * (1024d * 1024),
+ InformationUnit.Mebioctet => (_value * 8) * (1024d * 1024),
+ InformationUnit.Megabit => (_value) * 1e6d,
+ InformationUnit.Megabyte => (_value * 8) * 1e6d,
+ InformationUnit.Megaoctet => (_value * 8) * 1e6d,
+ InformationUnit.Octet => _value * 8,
+ InformationUnit.Pebibit => (_value) * (1024d * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Pebibyte => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Pebioctet => (_value * 8) * (1024d * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Petabit => (_value) * 1e15d,
+ InformationUnit.Petabyte => (_value * 8) * 1e15d,
+ InformationUnit.Petaoctet => (_value * 8) * 1e15d,
+ InformationUnit.Tebibit => (_value) * (1024d * 1024 * 1024 * 1024),
+ InformationUnit.Tebibyte => (_value * 8) * (1024d * 1024 * 1024 * 1024),
+ InformationUnit.Tebioctet => (_value * 8) * (1024d * 1024 * 1024 * 1024),
+ InformationUnit.Terabit => (_value) * 1e12d,
+ InformationUnit.Terabyte => (_value * 8) * 1e12d,
+ InformationUnit.Teraoctet => (_value * 8) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(InformationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ InformationUnit.Bit => baseUnitValue,
+ InformationUnit.Byte => baseUnitValue / 8,
+ InformationUnit.Exabit => (baseUnitValue) / 1e18d,
+ InformationUnit.Exabyte => (baseUnitValue / 8) / 1e18d,
+ InformationUnit.Exaoctet => (baseUnitValue / 8) / 1e18d,
+ InformationUnit.Exbibit => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Exbibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Exbioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Gibibit => (baseUnitValue) / (1024d * 1024 * 1024),
+ InformationUnit.Gibibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024),
+ InformationUnit.Gibioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024),
+ InformationUnit.Gigabit => (baseUnitValue) / 1e9d,
+ InformationUnit.Gigabyte => (baseUnitValue / 8) / 1e9d,
+ InformationUnit.Gigaoctet => (baseUnitValue / 8) / 1e9d,
+ InformationUnit.Kibibit => (baseUnitValue) / 1024d,
+ InformationUnit.Kibibyte => (baseUnitValue / 8) / 1024d,
+ InformationUnit.Kibioctet => (baseUnitValue / 8) / 1024d,
+ InformationUnit.Kilobit => (baseUnitValue) / 1e3d,
+ InformationUnit.Kilobyte => (baseUnitValue / 8) / 1e3d,
+ InformationUnit.Kilooctet => (baseUnitValue / 8) / 1e3d,
+ InformationUnit.Mebibit => (baseUnitValue) / (1024d * 1024),
+ InformationUnit.Mebibyte => (baseUnitValue / 8) / (1024d * 1024),
+ InformationUnit.Mebioctet => (baseUnitValue / 8) / (1024d * 1024),
+ InformationUnit.Megabit => (baseUnitValue) / 1e6d,
+ InformationUnit.Megabyte => (baseUnitValue / 8) / 1e6d,
+ InformationUnit.Megaoctet => (baseUnitValue / 8) / 1e6d,
+ InformationUnit.Octet => baseUnitValue / 8,
+ InformationUnit.Pebibit => (baseUnitValue) / (1024d * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Pebibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Pebioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024 * 1024),
+ InformationUnit.Petabit => (baseUnitValue) / 1e15d,
+ InformationUnit.Petabyte => (baseUnitValue / 8) / 1e15d,
+ InformationUnit.Petaoctet => (baseUnitValue / 8) / 1e15d,
+ InformationUnit.Tebibit => (baseUnitValue) / (1024d * 1024 * 1024 * 1024),
+ InformationUnit.Tebibyte => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
+ InformationUnit.Tebioctet => (baseUnitValue / 8) / (1024d * 1024 * 1024 * 1024),
+ InformationUnit.Terabit => (baseUnitValue) / 1e12d,
+ InformationUnit.Terabyte => (baseUnitValue / 8) / 1e12d,
+ InformationUnit.Teraoctet => (baseUnitValue / 8) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiance.g.cs
index 7675fb9f51..58f2326d7e 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiance.g.cs
@@ -235,79 +235,79 @@ public static Irradiance From(double value, IrradianceUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(IrradianceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Irradiance to another Irradiance with the unit representation .
- ///
- /// A Irradiance with the specified unit.
- public Irradiance ToUnit(IrradianceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Irradiance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- IrradianceUnit.KilowattPerSquareCentimeter => (_value * 10000) * 1e3d,
- IrradianceUnit.KilowattPerSquareMeter => (_value) * 1e3d,
- IrradianceUnit.MegawattPerSquareCentimeter => (_value * 10000) * 1e6d,
- IrradianceUnit.MegawattPerSquareMeter => (_value) * 1e6d,
- IrradianceUnit.MicrowattPerSquareCentimeter => (_value * 10000) * 1e-6d,
- IrradianceUnit.MicrowattPerSquareMeter => (_value) * 1e-6d,
- IrradianceUnit.MilliwattPerSquareCentimeter => (_value * 10000) * 1e-3d,
- IrradianceUnit.MilliwattPerSquareMeter => (_value) * 1e-3d,
- IrradianceUnit.NanowattPerSquareCentimeter => (_value * 10000) * 1e-9d,
- IrradianceUnit.NanowattPerSquareMeter => (_value) * 1e-9d,
- IrradianceUnit.PicowattPerSquareCentimeter => (_value * 10000) * 1e-12d,
- IrradianceUnit.PicowattPerSquareMeter => (_value) * 1e-12d,
- IrradianceUnit.WattPerSquareCentimeter => _value * 10000,
- IrradianceUnit.WattPerSquareMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(IrradianceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- IrradianceUnit.KilowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e3d,
- IrradianceUnit.KilowattPerSquareMeter => (baseUnitValue) / 1e3d,
- IrradianceUnit.MegawattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e6d,
- IrradianceUnit.MegawattPerSquareMeter => (baseUnitValue) / 1e6d,
- IrradianceUnit.MicrowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-6d,
- IrradianceUnit.MicrowattPerSquareMeter => (baseUnitValue) / 1e-6d,
- IrradianceUnit.MilliwattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-3d,
- IrradianceUnit.MilliwattPerSquareMeter => (baseUnitValue) / 1e-3d,
- IrradianceUnit.NanowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-9d,
- IrradianceUnit.NanowattPerSquareMeter => (baseUnitValue) / 1e-9d,
- IrradianceUnit.PicowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-12d,
- IrradianceUnit.PicowattPerSquareMeter => (baseUnitValue) / 1e-12d,
- IrradianceUnit.WattPerSquareCentimeter => baseUnitValue * 0.0001,
- IrradianceUnit.WattPerSquareMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(IrradianceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Irradiance to another Irradiance with the unit representation .
+ ///
+ /// A Irradiance with the specified unit.
+ public Irradiance ToUnit(IrradianceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Irradiance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ IrradianceUnit.KilowattPerSquareCentimeter => (_value * 10000) * 1e3d,
+ IrradianceUnit.KilowattPerSquareMeter => (_value) * 1e3d,
+ IrradianceUnit.MegawattPerSquareCentimeter => (_value * 10000) * 1e6d,
+ IrradianceUnit.MegawattPerSquareMeter => (_value) * 1e6d,
+ IrradianceUnit.MicrowattPerSquareCentimeter => (_value * 10000) * 1e-6d,
+ IrradianceUnit.MicrowattPerSquareMeter => (_value) * 1e-6d,
+ IrradianceUnit.MilliwattPerSquareCentimeter => (_value * 10000) * 1e-3d,
+ IrradianceUnit.MilliwattPerSquareMeter => (_value) * 1e-3d,
+ IrradianceUnit.NanowattPerSquareCentimeter => (_value * 10000) * 1e-9d,
+ IrradianceUnit.NanowattPerSquareMeter => (_value) * 1e-9d,
+ IrradianceUnit.PicowattPerSquareCentimeter => (_value * 10000) * 1e-12d,
+ IrradianceUnit.PicowattPerSquareMeter => (_value) * 1e-12d,
+ IrradianceUnit.WattPerSquareCentimeter => _value * 10000,
+ IrradianceUnit.WattPerSquareMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(IrradianceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ IrradianceUnit.KilowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e3d,
+ IrradianceUnit.KilowattPerSquareMeter => (baseUnitValue) / 1e3d,
+ IrradianceUnit.MegawattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e6d,
+ IrradianceUnit.MegawattPerSquareMeter => (baseUnitValue) / 1e6d,
+ IrradianceUnit.MicrowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-6d,
+ IrradianceUnit.MicrowattPerSquareMeter => (baseUnitValue) / 1e-6d,
+ IrradianceUnit.MilliwattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-3d,
+ IrradianceUnit.MilliwattPerSquareMeter => (baseUnitValue) / 1e-3d,
+ IrradianceUnit.NanowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-9d,
+ IrradianceUnit.NanowattPerSquareMeter => (baseUnitValue) / 1e-9d,
+ IrradianceUnit.PicowattPerSquareCentimeter => (baseUnitValue * 0.0001) / 1e-12d,
+ IrradianceUnit.PicowattPerSquareMeter => (baseUnitValue) / 1e-12d,
+ IrradianceUnit.WattPerSquareCentimeter => baseUnitValue * 0.0001,
+ IrradianceUnit.WattPerSquareMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiation.g.cs
index 0dadfda90a..c6804a513c 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiation.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Irradiation.g.cs
@@ -188,69 +188,69 @@ public static Irradiation From(double value, IrradiationUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(IrradiationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Irradiation to another Irradiation with the unit representation .
- ///
- /// A Irradiation with the specified unit.
- public Irradiation ToUnit(IrradiationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Irradiation(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- IrradiationUnit.BtuPerSquareFoot => _value * 1055.05585262 / 9.290304e-2,
- IrradiationUnit.JoulePerSquareCentimeter => _value * 1e4,
- IrradiationUnit.JoulePerSquareMeter => _value,
- IrradiationUnit.JoulePerSquareMillimeter => _value * 1e6,
- IrradiationUnit.KilobtuPerSquareFoot => (_value * 1055.05585262 / 9.290304e-2) * 1e3d,
- IrradiationUnit.KilojoulePerSquareMeter => (_value) * 1e3d,
- IrradiationUnit.KilowattHourPerSquareMeter => (_value * 3600d) * 1e3d,
- IrradiationUnit.MillijoulePerSquareCentimeter => (_value * 1e4) * 1e-3d,
- IrradiationUnit.WattHourPerSquareMeter => _value * 3600d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(IrradiationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- IrradiationUnit.BtuPerSquareFoot => baseUnitValue * 9.290304e-2 / 1055.05585262,
- IrradiationUnit.JoulePerSquareCentimeter => baseUnitValue / 1e4,
- IrradiationUnit.JoulePerSquareMeter => baseUnitValue,
- IrradiationUnit.JoulePerSquareMillimeter => baseUnitValue / 1e6,
- IrradiationUnit.KilobtuPerSquareFoot => (baseUnitValue * 9.290304e-2 / 1055.05585262) / 1e3d,
- IrradiationUnit.KilojoulePerSquareMeter => (baseUnitValue) / 1e3d,
- IrradiationUnit.KilowattHourPerSquareMeter => (baseUnitValue / 3600d) / 1e3d,
- IrradiationUnit.MillijoulePerSquareCentimeter => (baseUnitValue / 1e4) / 1e-3d,
- IrradiationUnit.WattHourPerSquareMeter => baseUnitValue / 3600d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(IrradiationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Irradiation to another Irradiation with the unit representation .
+ ///
+ /// A Irradiation with the specified unit.
+ public Irradiation ToUnit(IrradiationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Irradiation(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ IrradiationUnit.BtuPerSquareFoot => _value * 1055.05585262 / 9.290304e-2,
+ IrradiationUnit.JoulePerSquareCentimeter => _value * 1e4,
+ IrradiationUnit.JoulePerSquareMeter => _value,
+ IrradiationUnit.JoulePerSquareMillimeter => _value * 1e6,
+ IrradiationUnit.KilobtuPerSquareFoot => (_value * 1055.05585262 / 9.290304e-2) * 1e3d,
+ IrradiationUnit.KilojoulePerSquareMeter => (_value) * 1e3d,
+ IrradiationUnit.KilowattHourPerSquareMeter => (_value * 3600d) * 1e3d,
+ IrradiationUnit.MillijoulePerSquareCentimeter => (_value * 1e4) * 1e-3d,
+ IrradiationUnit.WattHourPerSquareMeter => _value * 3600d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(IrradiationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ IrradiationUnit.BtuPerSquareFoot => baseUnitValue * 9.290304e-2 / 1055.05585262,
+ IrradiationUnit.JoulePerSquareCentimeter => baseUnitValue / 1e4,
+ IrradiationUnit.JoulePerSquareMeter => baseUnitValue,
+ IrradiationUnit.JoulePerSquareMillimeter => baseUnitValue / 1e6,
+ IrradiationUnit.KilobtuPerSquareFoot => (baseUnitValue * 9.290304e-2 / 1055.05585262) / 1e3d,
+ IrradiationUnit.KilojoulePerSquareMeter => (baseUnitValue) / 1e3d,
+ IrradiationUnit.KilowattHourPerSquareMeter => (baseUnitValue / 3600d) / 1e3d,
+ IrradiationUnit.MillijoulePerSquareCentimeter => (baseUnitValue / 1e4) / 1e-3d,
+ IrradiationUnit.WattHourPerSquareMeter => baseUnitValue / 3600d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Jerk.g.cs
index f96b0cf1a9..7c2698aa04 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Jerk.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Jerk.g.cs
@@ -205,73 +205,73 @@ public static Jerk From(double value, JerkUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(JerkUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Jerk to another Jerk with the unit representation .
- ///
- /// A Jerk with the specified unit.
- public Jerk ToUnit(JerkUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Jerk(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- JerkUnit.CentimeterPerSecondCubed => (_value) * 1e-2d,
- JerkUnit.DecimeterPerSecondCubed => (_value) * 1e-1d,
- JerkUnit.FootPerSecondCubed => _value * 0.304800,
- JerkUnit.InchPerSecondCubed => _value * 0.0254,
- JerkUnit.KilometerPerSecondCubed => (_value) * 1e3d,
- JerkUnit.MeterPerSecondCubed => _value,
- JerkUnit.MicrometerPerSecondCubed => (_value) * 1e-6d,
- JerkUnit.MillimeterPerSecondCubed => (_value) * 1e-3d,
- JerkUnit.MillistandardGravitiesPerSecond => (_value * 9.80665) * 1e-3d,
- JerkUnit.NanometerPerSecondCubed => (_value) * 1e-9d,
- JerkUnit.StandardGravitiesPerSecond => _value * 9.80665,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(JerkUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- JerkUnit.CentimeterPerSecondCubed => (baseUnitValue) / 1e-2d,
- JerkUnit.DecimeterPerSecondCubed => (baseUnitValue) / 1e-1d,
- JerkUnit.FootPerSecondCubed => baseUnitValue / 0.304800,
- JerkUnit.InchPerSecondCubed => baseUnitValue / 0.0254,
- JerkUnit.KilometerPerSecondCubed => (baseUnitValue) / 1e3d,
- JerkUnit.MeterPerSecondCubed => baseUnitValue,
- JerkUnit.MicrometerPerSecondCubed => (baseUnitValue) / 1e-6d,
- JerkUnit.MillimeterPerSecondCubed => (baseUnitValue) / 1e-3d,
- JerkUnit.MillistandardGravitiesPerSecond => (baseUnitValue / 9.80665) / 1e-3d,
- JerkUnit.NanometerPerSecondCubed => (baseUnitValue) / 1e-9d,
- JerkUnit.StandardGravitiesPerSecond => baseUnitValue / 9.80665,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(JerkUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Jerk to another Jerk with the unit representation .
+ ///
+ /// A Jerk with the specified unit.
+ public Jerk ToUnit(JerkUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Jerk(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ JerkUnit.CentimeterPerSecondCubed => (_value) * 1e-2d,
+ JerkUnit.DecimeterPerSecondCubed => (_value) * 1e-1d,
+ JerkUnit.FootPerSecondCubed => _value * 0.304800,
+ JerkUnit.InchPerSecondCubed => _value * 0.0254,
+ JerkUnit.KilometerPerSecondCubed => (_value) * 1e3d,
+ JerkUnit.MeterPerSecondCubed => _value,
+ JerkUnit.MicrometerPerSecondCubed => (_value) * 1e-6d,
+ JerkUnit.MillimeterPerSecondCubed => (_value) * 1e-3d,
+ JerkUnit.MillistandardGravitiesPerSecond => (_value * 9.80665) * 1e-3d,
+ JerkUnit.NanometerPerSecondCubed => (_value) * 1e-9d,
+ JerkUnit.StandardGravitiesPerSecond => _value * 9.80665,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(JerkUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ JerkUnit.CentimeterPerSecondCubed => (baseUnitValue) / 1e-2d,
+ JerkUnit.DecimeterPerSecondCubed => (baseUnitValue) / 1e-1d,
+ JerkUnit.FootPerSecondCubed => baseUnitValue / 0.304800,
+ JerkUnit.InchPerSecondCubed => baseUnitValue / 0.0254,
+ JerkUnit.KilometerPerSecondCubed => (baseUnitValue) / 1e3d,
+ JerkUnit.MeterPerSecondCubed => baseUnitValue,
+ JerkUnit.MicrometerPerSecondCubed => (baseUnitValue) / 1e-6d,
+ JerkUnit.MillimeterPerSecondCubed => (baseUnitValue) / 1e-3d,
+ JerkUnit.MillistandardGravitiesPerSecond => (baseUnitValue / 9.80665) / 1e-3d,
+ JerkUnit.NanometerPerSecondCubed => (baseUnitValue) / 1e-9d,
+ JerkUnit.StandardGravitiesPerSecond => baseUnitValue / 9.80665,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/KinematicViscosity.g.cs
index 5f7200be13..913fb58410 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/KinematicViscosity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/KinematicViscosity.g.cs
@@ -188,69 +188,69 @@ public static KinematicViscosity From(double value, KinematicViscosityUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(KinematicViscosityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this KinematicViscosity to another KinematicViscosity with the unit representation .
- ///
- /// A KinematicViscosity with the specified unit.
- public KinematicViscosity ToUnit(KinematicViscosityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new KinematicViscosity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- KinematicViscosityUnit.Centistokes => (_value / 1e4) * 1e-2d,
- KinematicViscosityUnit.Decistokes => (_value / 1e4) * 1e-1d,
- KinematicViscosityUnit.Kilostokes => (_value / 1e4) * 1e3d,
- KinematicViscosityUnit.Microstokes => (_value / 1e4) * 1e-6d,
- KinematicViscosityUnit.Millistokes => (_value / 1e4) * 1e-3d,
- KinematicViscosityUnit.Nanostokes => (_value / 1e4) * 1e-9d,
- KinematicViscosityUnit.SquareFootPerSecond => _value * 9.290304e-2,
- KinematicViscosityUnit.SquareMeterPerSecond => _value,
- KinematicViscosityUnit.Stokes => _value / 1e4,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(KinematicViscosityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- KinematicViscosityUnit.Centistokes => (baseUnitValue * 1e4) / 1e-2d,
- KinematicViscosityUnit.Decistokes => (baseUnitValue * 1e4) / 1e-1d,
- KinematicViscosityUnit.Kilostokes => (baseUnitValue * 1e4) / 1e3d,
- KinematicViscosityUnit.Microstokes => (baseUnitValue * 1e4) / 1e-6d,
- KinematicViscosityUnit.Millistokes => (baseUnitValue * 1e4) / 1e-3d,
- KinematicViscosityUnit.Nanostokes => (baseUnitValue * 1e4) / 1e-9d,
- KinematicViscosityUnit.SquareFootPerSecond => baseUnitValue / 9.290304e-2,
- KinematicViscosityUnit.SquareMeterPerSecond => baseUnitValue,
- KinematicViscosityUnit.Stokes => baseUnitValue * 1e4,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(KinematicViscosityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this KinematicViscosity to another KinematicViscosity with the unit representation .
+ ///
+ /// A KinematicViscosity with the specified unit.
+ public KinematicViscosity ToUnit(KinematicViscosityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new KinematicViscosity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ KinematicViscosityUnit.Centistokes => (_value / 1e4) * 1e-2d,
+ KinematicViscosityUnit.Decistokes => (_value / 1e4) * 1e-1d,
+ KinematicViscosityUnit.Kilostokes => (_value / 1e4) * 1e3d,
+ KinematicViscosityUnit.Microstokes => (_value / 1e4) * 1e-6d,
+ KinematicViscosityUnit.Millistokes => (_value / 1e4) * 1e-3d,
+ KinematicViscosityUnit.Nanostokes => (_value / 1e4) * 1e-9d,
+ KinematicViscosityUnit.SquareFootPerSecond => _value * 9.290304e-2,
+ KinematicViscosityUnit.SquareMeterPerSecond => _value,
+ KinematicViscosityUnit.Stokes => _value / 1e4,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(KinematicViscosityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ KinematicViscosityUnit.Centistokes => (baseUnitValue * 1e4) / 1e-2d,
+ KinematicViscosityUnit.Decistokes => (baseUnitValue * 1e4) / 1e-1d,
+ KinematicViscosityUnit.Kilostokes => (baseUnitValue * 1e4) / 1e3d,
+ KinematicViscosityUnit.Microstokes => (baseUnitValue * 1e4) / 1e-6d,
+ KinematicViscosityUnit.Millistokes => (baseUnitValue * 1e4) / 1e-3d,
+ KinematicViscosityUnit.Nanostokes => (baseUnitValue * 1e4) / 1e-9d,
+ KinematicViscosityUnit.SquareFootPerSecond => baseUnitValue / 9.290304e-2,
+ KinematicViscosityUnit.SquareMeterPerSecond => baseUnitValue,
+ KinematicViscosityUnit.Stokes => baseUnitValue * 1e4,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LeakRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LeakRate.g.cs
index 0ae299985c..3921f1203a 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LeakRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LeakRate.g.cs
@@ -138,59 +138,59 @@ public static LeakRate From(double value, LeakRateUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LeakRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this LeakRate to another LeakRate with the unit representation .
- ///
- /// A LeakRate with the specified unit.
- public LeakRate ToUnit(LeakRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new LeakRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LeakRateUnit.AtmCubicCentimeterPerSecond => _value / (1e6 / 101325),
- LeakRateUnit.MillibarLiterPerSecond => _value / 10,
- LeakRateUnit.PascalCubicMeterPerSecond => _value,
- LeakRateUnit.TorrLiterPerSecond => _value / 7.5,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LeakRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LeakRateUnit.AtmCubicCentimeterPerSecond => baseUnitValue * (1e6 / 101325),
- LeakRateUnit.MillibarLiterPerSecond => baseUnitValue * 10,
- LeakRateUnit.PascalCubicMeterPerSecond => baseUnitValue,
- LeakRateUnit.TorrLiterPerSecond => baseUnitValue * 7.5,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LeakRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this LeakRate to another LeakRate with the unit representation .
+ ///
+ /// A LeakRate with the specified unit.
+ public LeakRate ToUnit(LeakRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new LeakRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LeakRateUnit.AtmCubicCentimeterPerSecond => _value / (1e6 / 101325),
+ LeakRateUnit.MillibarLiterPerSecond => _value / 10,
+ LeakRateUnit.PascalCubicMeterPerSecond => _value,
+ LeakRateUnit.TorrLiterPerSecond => _value / 7.5,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LeakRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LeakRateUnit.AtmCubicCentimeterPerSecond => baseUnitValue * (1e6 / 101325),
+ LeakRateUnit.MillibarLiterPerSecond => baseUnitValue * 10,
+ LeakRateUnit.PascalCubicMeterPerSecond => baseUnitValue,
+ LeakRateUnit.TorrLiterPerSecond => baseUnitValue * 7.5,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Length.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Length.g.cs
index a8540d56d6..6899b7c8e4 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Length.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Length.g.cs
@@ -515,135 +515,135 @@ public static Length From(double value, LengthUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LengthUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Length to another Length with the unit representation .
- ///
- /// A Length with the specified unit.
- public Length ToUnit(LengthUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Length(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LengthUnit.Angstrom => _value * 1e-10,
- LengthUnit.AstronomicalUnit => _value * 1.4959787070e11,
- LengthUnit.Centimeter => (_value) * 1e-2d,
- LengthUnit.Chain => _value * 20.1168,
- LengthUnit.DataMile => _value * 1828.8,
- LengthUnit.Decameter => (_value) * 1e1d,
- LengthUnit.Decimeter => (_value) * 1e-1d,
- LengthUnit.DtpPica => _value * 2.54e-2 / 6,
- LengthUnit.DtpPoint => _value * 2.54e-2 / 72,
- LengthUnit.Fathom => _value * 1.8288,
- LengthUnit.Femtometer => (_value) * 1e-15d,
- LengthUnit.Foot => _value * 0.3048,
- LengthUnit.Gigameter => (_value) * 1e9d,
- LengthUnit.Hand => _value * 1.016e-1,
- LengthUnit.Hectometer => (_value) * 1e2d,
- LengthUnit.Inch => _value * 2.54e-2,
- LengthUnit.Kilofoot => (_value * 0.3048) * 1e3d,
- LengthUnit.KilolightYear => (_value * 9.46073047258e15) * 1e3d,
- LengthUnit.Kilometer => (_value) * 1e3d,
- LengthUnit.Kiloparsec => (_value * 3.08567758128e16) * 1e3d,
- LengthUnit.Kiloyard => (_value * 0.9144) * 1e3d,
- LengthUnit.LightYear => _value * 9.46073047258e15,
- LengthUnit.MegalightYear => (_value * 9.46073047258e15) * 1e6d,
- LengthUnit.Megameter => (_value) * 1e6d,
- LengthUnit.Megaparsec => (_value * 3.08567758128e16) * 1e6d,
- LengthUnit.Meter => _value,
- LengthUnit.Microinch => _value * 2.54e-8,
- LengthUnit.Micrometer => (_value) * 1e-6d,
- LengthUnit.Mil => _value * 2.54e-5,
- LengthUnit.Mile => _value * 1609.344,
- LengthUnit.Millimeter => (_value) * 1e-3d,
- LengthUnit.Nanometer => (_value) * 1e-9d,
- LengthUnit.NauticalMile => _value * 1852,
- LengthUnit.Parsec => _value * 3.08567758128e16,
- LengthUnit.Picometer => (_value) * 1e-12d,
- LengthUnit.PrinterPica => _value * 2.54e-2 * 400 / 2409,
- LengthUnit.PrinterPoint => _value * 2.54e-2 / 72.27 ,
- LengthUnit.Shackle => _value * 27.432,
- LengthUnit.SolarRadius => _value * 6.95700e8,
- LengthUnit.Twip => _value * 2.54e-2 / 1440,
- LengthUnit.UsSurveyFoot => _value * 1200 / 3937,
- LengthUnit.Yard => _value * 0.9144,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LengthUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LengthUnit.Angstrom => baseUnitValue / 1e-10,
- LengthUnit.AstronomicalUnit => baseUnitValue / 1.4959787070e11,
- LengthUnit.Centimeter => (baseUnitValue) / 1e-2d,
- LengthUnit.Chain => baseUnitValue / 20.1168,
- LengthUnit.DataMile => baseUnitValue / 1828.8,
- LengthUnit.Decameter => (baseUnitValue) / 1e1d,
- LengthUnit.Decimeter => (baseUnitValue) / 1e-1d,
- LengthUnit.DtpPica => baseUnitValue * 6 / 2.54e-2,
- LengthUnit.DtpPoint => baseUnitValue * 72 / 2.54e-2,
- LengthUnit.Fathom => baseUnitValue / 1.8288,
- LengthUnit.Femtometer => (baseUnitValue) / 1e-15d,
- LengthUnit.Foot => baseUnitValue / 0.3048,
- LengthUnit.Gigameter => (baseUnitValue) / 1e9d,
- LengthUnit.Hand => baseUnitValue / 1.016e-1,
- LengthUnit.Hectometer => (baseUnitValue) / 1e2d,
- LengthUnit.Inch => baseUnitValue / 2.54e-2,
- LengthUnit.Kilofoot => (baseUnitValue / 0.3048) / 1e3d,
- LengthUnit.KilolightYear => (baseUnitValue / 9.46073047258e15) / 1e3d,
- LengthUnit.Kilometer => (baseUnitValue) / 1e3d,
- LengthUnit.Kiloparsec => (baseUnitValue / 3.08567758128e16) / 1e3d,
- LengthUnit.Kiloyard => (baseUnitValue / 0.9144) / 1e3d,
- LengthUnit.LightYear => baseUnitValue / 9.46073047258e15,
- LengthUnit.MegalightYear => (baseUnitValue / 9.46073047258e15) / 1e6d,
- LengthUnit.Megameter => (baseUnitValue) / 1e6d,
- LengthUnit.Megaparsec => (baseUnitValue / 3.08567758128e16) / 1e6d,
- LengthUnit.Meter => baseUnitValue,
- LengthUnit.Microinch => baseUnitValue / 2.54e-8,
- LengthUnit.Micrometer => (baseUnitValue) / 1e-6d,
- LengthUnit.Mil => baseUnitValue / 2.54e-5,
- LengthUnit.Mile => baseUnitValue / 1609.344,
- LengthUnit.Millimeter => (baseUnitValue) / 1e-3d,
- LengthUnit.Nanometer => (baseUnitValue) / 1e-9d,
- LengthUnit.NauticalMile => baseUnitValue / 1852,
- LengthUnit.Parsec => baseUnitValue / 3.08567758128e16,
- LengthUnit.Picometer => (baseUnitValue) / 1e-12d,
- LengthUnit.PrinterPica => baseUnitValue / (2.54e-2 * 400 / 2409),
- LengthUnit.PrinterPoint => baseUnitValue * 72.27 / 2.54e-2,
- LengthUnit.Shackle => baseUnitValue / 27.432,
- LengthUnit.SolarRadius => baseUnitValue / 6.95700e8,
- LengthUnit.Twip => baseUnitValue * 1440 / 2.54e-2,
- LengthUnit.UsSurveyFoot => baseUnitValue * 3937 / 1200,
- LengthUnit.Yard => baseUnitValue / 0.9144,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LengthUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Length to another Length with the unit representation .
+ ///
+ /// A Length with the specified unit.
+ public Length ToUnit(LengthUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Length(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LengthUnit.Angstrom => _value * 1e-10,
+ LengthUnit.AstronomicalUnit => _value * 1.4959787070e11,
+ LengthUnit.Centimeter => (_value) * 1e-2d,
+ LengthUnit.Chain => _value * 20.1168,
+ LengthUnit.DataMile => _value * 1828.8,
+ LengthUnit.Decameter => (_value) * 1e1d,
+ LengthUnit.Decimeter => (_value) * 1e-1d,
+ LengthUnit.DtpPica => _value * 2.54e-2 / 6,
+ LengthUnit.DtpPoint => _value * 2.54e-2 / 72,
+ LengthUnit.Fathom => _value * 1.8288,
+ LengthUnit.Femtometer => (_value) * 1e-15d,
+ LengthUnit.Foot => _value * 0.3048,
+ LengthUnit.Gigameter => (_value) * 1e9d,
+ LengthUnit.Hand => _value * 1.016e-1,
+ LengthUnit.Hectometer => (_value) * 1e2d,
+ LengthUnit.Inch => _value * 2.54e-2,
+ LengthUnit.Kilofoot => (_value * 0.3048) * 1e3d,
+ LengthUnit.KilolightYear => (_value * 9.46073047258e15) * 1e3d,
+ LengthUnit.Kilometer => (_value) * 1e3d,
+ LengthUnit.Kiloparsec => (_value * 3.08567758128e16) * 1e3d,
+ LengthUnit.Kiloyard => (_value * 0.9144) * 1e3d,
+ LengthUnit.LightYear => _value * 9.46073047258e15,
+ LengthUnit.MegalightYear => (_value * 9.46073047258e15) * 1e6d,
+ LengthUnit.Megameter => (_value) * 1e6d,
+ LengthUnit.Megaparsec => (_value * 3.08567758128e16) * 1e6d,
+ LengthUnit.Meter => _value,
+ LengthUnit.Microinch => _value * 2.54e-8,
+ LengthUnit.Micrometer => (_value) * 1e-6d,
+ LengthUnit.Mil => _value * 2.54e-5,
+ LengthUnit.Mile => _value * 1609.344,
+ LengthUnit.Millimeter => (_value) * 1e-3d,
+ LengthUnit.Nanometer => (_value) * 1e-9d,
+ LengthUnit.NauticalMile => _value * 1852,
+ LengthUnit.Parsec => _value * 3.08567758128e16,
+ LengthUnit.Picometer => (_value) * 1e-12d,
+ LengthUnit.PrinterPica => _value * 2.54e-2 * 400 / 2409,
+ LengthUnit.PrinterPoint => _value * 2.54e-2 / 72.27 ,
+ LengthUnit.Shackle => _value * 27.432,
+ LengthUnit.SolarRadius => _value * 6.95700e8,
+ LengthUnit.Twip => _value * 2.54e-2 / 1440,
+ LengthUnit.UsSurveyFoot => _value * 1200 / 3937,
+ LengthUnit.Yard => _value * 0.9144,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LengthUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LengthUnit.Angstrom => baseUnitValue / 1e-10,
+ LengthUnit.AstronomicalUnit => baseUnitValue / 1.4959787070e11,
+ LengthUnit.Centimeter => (baseUnitValue) / 1e-2d,
+ LengthUnit.Chain => baseUnitValue / 20.1168,
+ LengthUnit.DataMile => baseUnitValue / 1828.8,
+ LengthUnit.Decameter => (baseUnitValue) / 1e1d,
+ LengthUnit.Decimeter => (baseUnitValue) / 1e-1d,
+ LengthUnit.DtpPica => baseUnitValue * 6 / 2.54e-2,
+ LengthUnit.DtpPoint => baseUnitValue * 72 / 2.54e-2,
+ LengthUnit.Fathom => baseUnitValue / 1.8288,
+ LengthUnit.Femtometer => (baseUnitValue) / 1e-15d,
+ LengthUnit.Foot => baseUnitValue / 0.3048,
+ LengthUnit.Gigameter => (baseUnitValue) / 1e9d,
+ LengthUnit.Hand => baseUnitValue / 1.016e-1,
+ LengthUnit.Hectometer => (baseUnitValue) / 1e2d,
+ LengthUnit.Inch => baseUnitValue / 2.54e-2,
+ LengthUnit.Kilofoot => (baseUnitValue / 0.3048) / 1e3d,
+ LengthUnit.KilolightYear => (baseUnitValue / 9.46073047258e15) / 1e3d,
+ LengthUnit.Kilometer => (baseUnitValue) / 1e3d,
+ LengthUnit.Kiloparsec => (baseUnitValue / 3.08567758128e16) / 1e3d,
+ LengthUnit.Kiloyard => (baseUnitValue / 0.9144) / 1e3d,
+ LengthUnit.LightYear => baseUnitValue / 9.46073047258e15,
+ LengthUnit.MegalightYear => (baseUnitValue / 9.46073047258e15) / 1e6d,
+ LengthUnit.Megameter => (baseUnitValue) / 1e6d,
+ LengthUnit.Megaparsec => (baseUnitValue / 3.08567758128e16) / 1e6d,
+ LengthUnit.Meter => baseUnitValue,
+ LengthUnit.Microinch => baseUnitValue / 2.54e-8,
+ LengthUnit.Micrometer => (baseUnitValue) / 1e-6d,
+ LengthUnit.Mil => baseUnitValue / 2.54e-5,
+ LengthUnit.Mile => baseUnitValue / 1609.344,
+ LengthUnit.Millimeter => (baseUnitValue) / 1e-3d,
+ LengthUnit.Nanometer => (baseUnitValue) / 1e-9d,
+ LengthUnit.NauticalMile => baseUnitValue / 1852,
+ LengthUnit.Parsec => baseUnitValue / 3.08567758128e16,
+ LengthUnit.Picometer => (baseUnitValue) / 1e-12d,
+ LengthUnit.PrinterPica => baseUnitValue / (2.54e-2 * 400 / 2409),
+ LengthUnit.PrinterPoint => baseUnitValue * 72.27 / 2.54e-2,
+ LengthUnit.Shackle => baseUnitValue / 27.432,
+ LengthUnit.SolarRadius => baseUnitValue / 6.95700e8,
+ LengthUnit.Twip => baseUnitValue * 1440 / 2.54e-2,
+ LengthUnit.UsSurveyFoot => baseUnitValue * 3937 / 1200,
+ LengthUnit.Yard => baseUnitValue / 0.9144,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Level.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Level.g.cs
index 24cc01e92f..48753397c9 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Level.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Level.g.cs
@@ -115,55 +115,55 @@ public static Level From(double value, LevelUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LevelUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Level to another Level with the unit representation .
- ///
- /// A Level with the specified unit.
- public Level ToUnit(LevelUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Level(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LevelUnit.Decibel => _value,
- LevelUnit.Neper => (1 / 0.115129254) * _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LevelUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LevelUnit.Decibel => baseUnitValue,
- LevelUnit.Neper => 0.115129254 * baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LevelUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Level to another Level with the unit representation .
+ ///
+ /// A Level with the specified unit.
+ public Level ToUnit(LevelUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Level(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LevelUnit.Decibel => _value,
+ LevelUnit.Neper => (1 / 0.115129254) * _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LevelUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LevelUnit.Decibel => baseUnitValue,
+ LevelUnit.Neper => 0.115129254 * baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearDensity.g.cs
index 5c7c965719..9961bdae1b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearDensity.g.cs
@@ -278,87 +278,87 @@ public static LinearDensity From(double value, LinearDensityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LinearDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this LinearDensity to another LinearDensity with the unit representation .
- ///
- /// A LinearDensity with the specified unit.
- public LinearDensity ToUnit(LinearDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new LinearDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LinearDensityUnit.GramPerCentimeter => _value * 1e-1,
- LinearDensityUnit.GramPerFoot => _value * ( 1e-3 / 0.3048 ),
- LinearDensityUnit.GramPerMeter => _value * 1e-3,
- LinearDensityUnit.GramPerMillimeter => _value,
- LinearDensityUnit.KilogramPerCentimeter => (_value * 1e-1) * 1e3d,
- LinearDensityUnit.KilogramPerFoot => (_value * ( 1e-3 / 0.3048 )) * 1e3d,
- LinearDensityUnit.KilogramPerMeter => (_value * 1e-3) * 1e3d,
- LinearDensityUnit.KilogramPerMillimeter => (_value) * 1e3d,
- LinearDensityUnit.MicrogramPerCentimeter => (_value * 1e-1) * 1e-6d,
- LinearDensityUnit.MicrogramPerFoot => (_value * ( 1e-3 / 0.3048 )) * 1e-6d,
- LinearDensityUnit.MicrogramPerMeter => (_value * 1e-3) * 1e-6d,
- LinearDensityUnit.MicrogramPerMillimeter => (_value) * 1e-6d,
- LinearDensityUnit.MilligramPerCentimeter => (_value * 1e-1) * 1e-3d,
- LinearDensityUnit.MilligramPerFoot => (_value * ( 1e-3 / 0.3048 )) * 1e-3d,
- LinearDensityUnit.MilligramPerMeter => (_value * 1e-3) * 1e-3d,
- LinearDensityUnit.MilligramPerMillimeter => (_value) * 1e-3d,
- LinearDensityUnit.PoundPerFoot => _value * 0.45359237 / 0.3048,
- LinearDensityUnit.PoundPerInch => _value * 0.45359237 / 2.54e-2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LinearDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LinearDensityUnit.GramPerCentimeter => baseUnitValue / 1e-1,
- LinearDensityUnit.GramPerFoot => baseUnitValue / ( 1e-3 / 0.3048 ),
- LinearDensityUnit.GramPerMeter => baseUnitValue / 1e-3,
- LinearDensityUnit.GramPerMillimeter => baseUnitValue,
- LinearDensityUnit.KilogramPerCentimeter => (baseUnitValue / 1e-1) / 1e3d,
- LinearDensityUnit.KilogramPerFoot => (baseUnitValue / ( 1e-3 / 0.3048 )) / 1e3d,
- LinearDensityUnit.KilogramPerMeter => (baseUnitValue / 1e-3) / 1e3d,
- LinearDensityUnit.KilogramPerMillimeter => (baseUnitValue) / 1e3d,
- LinearDensityUnit.MicrogramPerCentimeter => (baseUnitValue / 1e-1) / 1e-6d,
- LinearDensityUnit.MicrogramPerFoot => (baseUnitValue / ( 1e-3 / 0.3048 )) / 1e-6d,
- LinearDensityUnit.MicrogramPerMeter => (baseUnitValue / 1e-3) / 1e-6d,
- LinearDensityUnit.MicrogramPerMillimeter => (baseUnitValue) / 1e-6d,
- LinearDensityUnit.MilligramPerCentimeter => (baseUnitValue / 1e-1) / 1e-3d,
- LinearDensityUnit.MilligramPerFoot => (baseUnitValue / ( 1e-3 / 0.3048 )) / 1e-3d,
- LinearDensityUnit.MilligramPerMeter => (baseUnitValue / 1e-3) / 1e-3d,
- LinearDensityUnit.MilligramPerMillimeter => (baseUnitValue) / 1e-3d,
- LinearDensityUnit.PoundPerFoot => baseUnitValue * 0.3048 / 0.45359237,
- LinearDensityUnit.PoundPerInch => baseUnitValue * 2.54e-2 / 0.45359237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LinearDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this LinearDensity to another LinearDensity with the unit representation .
+ ///
+ /// A LinearDensity with the specified unit.
+ public LinearDensity ToUnit(LinearDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new LinearDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LinearDensityUnit.GramPerCentimeter => _value * 1e-1,
+ LinearDensityUnit.GramPerFoot => _value * ( 1e-3 / 0.3048 ),
+ LinearDensityUnit.GramPerMeter => _value * 1e-3,
+ LinearDensityUnit.GramPerMillimeter => _value,
+ LinearDensityUnit.KilogramPerCentimeter => (_value * 1e-1) * 1e3d,
+ LinearDensityUnit.KilogramPerFoot => (_value * ( 1e-3 / 0.3048 )) * 1e3d,
+ LinearDensityUnit.KilogramPerMeter => (_value * 1e-3) * 1e3d,
+ LinearDensityUnit.KilogramPerMillimeter => (_value) * 1e3d,
+ LinearDensityUnit.MicrogramPerCentimeter => (_value * 1e-1) * 1e-6d,
+ LinearDensityUnit.MicrogramPerFoot => (_value * ( 1e-3 / 0.3048 )) * 1e-6d,
+ LinearDensityUnit.MicrogramPerMeter => (_value * 1e-3) * 1e-6d,
+ LinearDensityUnit.MicrogramPerMillimeter => (_value) * 1e-6d,
+ LinearDensityUnit.MilligramPerCentimeter => (_value * 1e-1) * 1e-3d,
+ LinearDensityUnit.MilligramPerFoot => (_value * ( 1e-3 / 0.3048 )) * 1e-3d,
+ LinearDensityUnit.MilligramPerMeter => (_value * 1e-3) * 1e-3d,
+ LinearDensityUnit.MilligramPerMillimeter => (_value) * 1e-3d,
+ LinearDensityUnit.PoundPerFoot => _value * 0.45359237 / 0.3048,
+ LinearDensityUnit.PoundPerInch => _value * 0.45359237 / 2.54e-2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LinearDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LinearDensityUnit.GramPerCentimeter => baseUnitValue / 1e-1,
+ LinearDensityUnit.GramPerFoot => baseUnitValue / ( 1e-3 / 0.3048 ),
+ LinearDensityUnit.GramPerMeter => baseUnitValue / 1e-3,
+ LinearDensityUnit.GramPerMillimeter => baseUnitValue,
+ LinearDensityUnit.KilogramPerCentimeter => (baseUnitValue / 1e-1) / 1e3d,
+ LinearDensityUnit.KilogramPerFoot => (baseUnitValue / ( 1e-3 / 0.3048 )) / 1e3d,
+ LinearDensityUnit.KilogramPerMeter => (baseUnitValue / 1e-3) / 1e3d,
+ LinearDensityUnit.KilogramPerMillimeter => (baseUnitValue) / 1e3d,
+ LinearDensityUnit.MicrogramPerCentimeter => (baseUnitValue / 1e-1) / 1e-6d,
+ LinearDensityUnit.MicrogramPerFoot => (baseUnitValue / ( 1e-3 / 0.3048 )) / 1e-6d,
+ LinearDensityUnit.MicrogramPerMeter => (baseUnitValue / 1e-3) / 1e-6d,
+ LinearDensityUnit.MicrogramPerMillimeter => (baseUnitValue) / 1e-6d,
+ LinearDensityUnit.MilligramPerCentimeter => (baseUnitValue / 1e-1) / 1e-3d,
+ LinearDensityUnit.MilligramPerFoot => (baseUnitValue / ( 1e-3 / 0.3048 )) / 1e-3d,
+ LinearDensityUnit.MilligramPerMeter => (baseUnitValue / 1e-3) / 1e-3d,
+ LinearDensityUnit.MilligramPerMillimeter => (baseUnitValue) / 1e-3d,
+ LinearDensityUnit.PoundPerFoot => baseUnitValue * 0.3048 / 0.45359237,
+ LinearDensityUnit.PoundPerInch => baseUnitValue * 2.54e-2 / 0.45359237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearPowerDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearPowerDensity.g.cs
index 5823bb4713..10b92d0057 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearPowerDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LinearPowerDensity.g.cs
@@ -348,101 +348,101 @@ public static LinearPowerDensity From(double value, LinearPowerDensityUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LinearPowerDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this LinearPowerDensity to another LinearPowerDensity with the unit representation .
- ///
- /// A LinearPowerDensity with the specified unit.
- public LinearPowerDensity ToUnit(LinearPowerDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new LinearPowerDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LinearPowerDensityUnit.GigawattPerCentimeter => (_value * 1e2) * 1e9d,
- LinearPowerDensityUnit.GigawattPerFoot => (_value / 0.3048) * 1e9d,
- LinearPowerDensityUnit.GigawattPerInch => (_value / 2.54e-2) * 1e9d,
- LinearPowerDensityUnit.GigawattPerMeter => (_value) * 1e9d,
- LinearPowerDensityUnit.GigawattPerMillimeter => (_value * 1e3) * 1e9d,
- LinearPowerDensityUnit.KilowattPerCentimeter => (_value * 1e2) * 1e3d,
- LinearPowerDensityUnit.KilowattPerFoot => (_value / 0.3048) * 1e3d,
- LinearPowerDensityUnit.KilowattPerInch => (_value / 2.54e-2) * 1e3d,
- LinearPowerDensityUnit.KilowattPerMeter => (_value) * 1e3d,
- LinearPowerDensityUnit.KilowattPerMillimeter => (_value * 1e3) * 1e3d,
- LinearPowerDensityUnit.MegawattPerCentimeter => (_value * 1e2) * 1e6d,
- LinearPowerDensityUnit.MegawattPerFoot => (_value / 0.3048) * 1e6d,
- LinearPowerDensityUnit.MegawattPerInch => (_value / 2.54e-2) * 1e6d,
- LinearPowerDensityUnit.MegawattPerMeter => (_value) * 1e6d,
- LinearPowerDensityUnit.MegawattPerMillimeter => (_value * 1e3) * 1e6d,
- LinearPowerDensityUnit.MilliwattPerCentimeter => (_value * 1e2) * 1e-3d,
- LinearPowerDensityUnit.MilliwattPerFoot => (_value / 0.3048) * 1e-3d,
- LinearPowerDensityUnit.MilliwattPerInch => (_value / 2.54e-2) * 1e-3d,
- LinearPowerDensityUnit.MilliwattPerMeter => (_value) * 1e-3d,
- LinearPowerDensityUnit.MilliwattPerMillimeter => (_value * 1e3) * 1e-3d,
- LinearPowerDensityUnit.WattPerCentimeter => _value * 1e2,
- LinearPowerDensityUnit.WattPerFoot => _value / 0.3048,
- LinearPowerDensityUnit.WattPerInch => _value / 2.54e-2,
- LinearPowerDensityUnit.WattPerMeter => _value,
- LinearPowerDensityUnit.WattPerMillimeter => _value * 1e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LinearPowerDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LinearPowerDensityUnit.GigawattPerCentimeter => (baseUnitValue / 1e2) / 1e9d,
- LinearPowerDensityUnit.GigawattPerFoot => (baseUnitValue * 0.3048) / 1e9d,
- LinearPowerDensityUnit.GigawattPerInch => (baseUnitValue * 2.54e-2) / 1e9d,
- LinearPowerDensityUnit.GigawattPerMeter => (baseUnitValue) / 1e9d,
- LinearPowerDensityUnit.GigawattPerMillimeter => (baseUnitValue / 1e3) / 1e9d,
- LinearPowerDensityUnit.KilowattPerCentimeter => (baseUnitValue / 1e2) / 1e3d,
- LinearPowerDensityUnit.KilowattPerFoot => (baseUnitValue * 0.3048) / 1e3d,
- LinearPowerDensityUnit.KilowattPerInch => (baseUnitValue * 2.54e-2) / 1e3d,
- LinearPowerDensityUnit.KilowattPerMeter => (baseUnitValue) / 1e3d,
- LinearPowerDensityUnit.KilowattPerMillimeter => (baseUnitValue / 1e3) / 1e3d,
- LinearPowerDensityUnit.MegawattPerCentimeter => (baseUnitValue / 1e2) / 1e6d,
- LinearPowerDensityUnit.MegawattPerFoot => (baseUnitValue * 0.3048) / 1e6d,
- LinearPowerDensityUnit.MegawattPerInch => (baseUnitValue * 2.54e-2) / 1e6d,
- LinearPowerDensityUnit.MegawattPerMeter => (baseUnitValue) / 1e6d,
- LinearPowerDensityUnit.MegawattPerMillimeter => (baseUnitValue / 1e3) / 1e6d,
- LinearPowerDensityUnit.MilliwattPerCentimeter => (baseUnitValue / 1e2) / 1e-3d,
- LinearPowerDensityUnit.MilliwattPerFoot => (baseUnitValue * 0.3048) / 1e-3d,
- LinearPowerDensityUnit.MilliwattPerInch => (baseUnitValue * 2.54e-2) / 1e-3d,
- LinearPowerDensityUnit.MilliwattPerMeter => (baseUnitValue) / 1e-3d,
- LinearPowerDensityUnit.MilliwattPerMillimeter => (baseUnitValue / 1e3) / 1e-3d,
- LinearPowerDensityUnit.WattPerCentimeter => baseUnitValue / 1e2,
- LinearPowerDensityUnit.WattPerFoot => baseUnitValue * 0.3048,
- LinearPowerDensityUnit.WattPerInch => baseUnitValue * 2.54e-2,
- LinearPowerDensityUnit.WattPerMeter => baseUnitValue,
- LinearPowerDensityUnit.WattPerMillimeter => baseUnitValue / 1e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LinearPowerDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this LinearPowerDensity to another LinearPowerDensity with the unit representation .
+ ///
+ /// A LinearPowerDensity with the specified unit.
+ public LinearPowerDensity ToUnit(LinearPowerDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new LinearPowerDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LinearPowerDensityUnit.GigawattPerCentimeter => (_value * 1e2) * 1e9d,
+ LinearPowerDensityUnit.GigawattPerFoot => (_value / 0.3048) * 1e9d,
+ LinearPowerDensityUnit.GigawattPerInch => (_value / 2.54e-2) * 1e9d,
+ LinearPowerDensityUnit.GigawattPerMeter => (_value) * 1e9d,
+ LinearPowerDensityUnit.GigawattPerMillimeter => (_value * 1e3) * 1e9d,
+ LinearPowerDensityUnit.KilowattPerCentimeter => (_value * 1e2) * 1e3d,
+ LinearPowerDensityUnit.KilowattPerFoot => (_value / 0.3048) * 1e3d,
+ LinearPowerDensityUnit.KilowattPerInch => (_value / 2.54e-2) * 1e3d,
+ LinearPowerDensityUnit.KilowattPerMeter => (_value) * 1e3d,
+ LinearPowerDensityUnit.KilowattPerMillimeter => (_value * 1e3) * 1e3d,
+ LinearPowerDensityUnit.MegawattPerCentimeter => (_value * 1e2) * 1e6d,
+ LinearPowerDensityUnit.MegawattPerFoot => (_value / 0.3048) * 1e6d,
+ LinearPowerDensityUnit.MegawattPerInch => (_value / 2.54e-2) * 1e6d,
+ LinearPowerDensityUnit.MegawattPerMeter => (_value) * 1e6d,
+ LinearPowerDensityUnit.MegawattPerMillimeter => (_value * 1e3) * 1e6d,
+ LinearPowerDensityUnit.MilliwattPerCentimeter => (_value * 1e2) * 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerFoot => (_value / 0.3048) * 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerInch => (_value / 2.54e-2) * 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerMeter => (_value) * 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerMillimeter => (_value * 1e3) * 1e-3d,
+ LinearPowerDensityUnit.WattPerCentimeter => _value * 1e2,
+ LinearPowerDensityUnit.WattPerFoot => _value / 0.3048,
+ LinearPowerDensityUnit.WattPerInch => _value / 2.54e-2,
+ LinearPowerDensityUnit.WattPerMeter => _value,
+ LinearPowerDensityUnit.WattPerMillimeter => _value * 1e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LinearPowerDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LinearPowerDensityUnit.GigawattPerCentimeter => (baseUnitValue / 1e2) / 1e9d,
+ LinearPowerDensityUnit.GigawattPerFoot => (baseUnitValue * 0.3048) / 1e9d,
+ LinearPowerDensityUnit.GigawattPerInch => (baseUnitValue * 2.54e-2) / 1e9d,
+ LinearPowerDensityUnit.GigawattPerMeter => (baseUnitValue) / 1e9d,
+ LinearPowerDensityUnit.GigawattPerMillimeter => (baseUnitValue / 1e3) / 1e9d,
+ LinearPowerDensityUnit.KilowattPerCentimeter => (baseUnitValue / 1e2) / 1e3d,
+ LinearPowerDensityUnit.KilowattPerFoot => (baseUnitValue * 0.3048) / 1e3d,
+ LinearPowerDensityUnit.KilowattPerInch => (baseUnitValue * 2.54e-2) / 1e3d,
+ LinearPowerDensityUnit.KilowattPerMeter => (baseUnitValue) / 1e3d,
+ LinearPowerDensityUnit.KilowattPerMillimeter => (baseUnitValue / 1e3) / 1e3d,
+ LinearPowerDensityUnit.MegawattPerCentimeter => (baseUnitValue / 1e2) / 1e6d,
+ LinearPowerDensityUnit.MegawattPerFoot => (baseUnitValue * 0.3048) / 1e6d,
+ LinearPowerDensityUnit.MegawattPerInch => (baseUnitValue * 2.54e-2) / 1e6d,
+ LinearPowerDensityUnit.MegawattPerMeter => (baseUnitValue) / 1e6d,
+ LinearPowerDensityUnit.MegawattPerMillimeter => (baseUnitValue / 1e3) / 1e6d,
+ LinearPowerDensityUnit.MilliwattPerCentimeter => (baseUnitValue / 1e2) / 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerFoot => (baseUnitValue * 0.3048) / 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerInch => (baseUnitValue * 2.54e-2) / 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerMeter => (baseUnitValue) / 1e-3d,
+ LinearPowerDensityUnit.MilliwattPerMillimeter => (baseUnitValue / 1e3) / 1e-3d,
+ LinearPowerDensityUnit.WattPerCentimeter => baseUnitValue / 1e2,
+ LinearPowerDensityUnit.WattPerFoot => baseUnitValue * 0.3048,
+ LinearPowerDensityUnit.WattPerInch => baseUnitValue * 2.54e-2,
+ LinearPowerDensityUnit.WattPerMeter => baseUnitValue,
+ LinearPowerDensityUnit.WattPerMillimeter => baseUnitValue / 1e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminance.g.cs
index e891857e2f..c6b4526a59 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminance.g.cs
@@ -198,71 +198,71 @@ public static Luminance From(double value, LuminanceUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LuminanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Luminance to another Luminance with the unit representation .
- ///
- /// A Luminance with the specified unit.
- public Luminance ToUnit(LuminanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Luminance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LuminanceUnit.CandelaPerSquareFoot => _value / 9.290304e-2,
- LuminanceUnit.CandelaPerSquareInch => _value / 0.00064516,
- LuminanceUnit.CandelaPerSquareMeter => _value,
- LuminanceUnit.CenticandelaPerSquareMeter => (_value) * 1e-2d,
- LuminanceUnit.DecicandelaPerSquareMeter => (_value) * 1e-1d,
- LuminanceUnit.KilocandelaPerSquareMeter => (_value) * 1e3d,
- LuminanceUnit.MicrocandelaPerSquareMeter => (_value) * 1e-6d,
- LuminanceUnit.MillicandelaPerSquareMeter => (_value) * 1e-3d,
- LuminanceUnit.NanocandelaPerSquareMeter => (_value) * 1e-9d,
- LuminanceUnit.Nit => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LuminanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LuminanceUnit.CandelaPerSquareFoot => baseUnitValue * 9.290304e-2,
- LuminanceUnit.CandelaPerSquareInch => baseUnitValue * 0.00064516,
- LuminanceUnit.CandelaPerSquareMeter => baseUnitValue,
- LuminanceUnit.CenticandelaPerSquareMeter => (baseUnitValue) / 1e-2d,
- LuminanceUnit.DecicandelaPerSquareMeter => (baseUnitValue) / 1e-1d,
- LuminanceUnit.KilocandelaPerSquareMeter => (baseUnitValue) / 1e3d,
- LuminanceUnit.MicrocandelaPerSquareMeter => (baseUnitValue) / 1e-6d,
- LuminanceUnit.MillicandelaPerSquareMeter => (baseUnitValue) / 1e-3d,
- LuminanceUnit.NanocandelaPerSquareMeter => (baseUnitValue) / 1e-9d,
- LuminanceUnit.Nit => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LuminanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Luminance to another Luminance with the unit representation .
+ ///
+ /// A Luminance with the specified unit.
+ public Luminance ToUnit(LuminanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Luminance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LuminanceUnit.CandelaPerSquareFoot => _value / 9.290304e-2,
+ LuminanceUnit.CandelaPerSquareInch => _value / 0.00064516,
+ LuminanceUnit.CandelaPerSquareMeter => _value,
+ LuminanceUnit.CenticandelaPerSquareMeter => (_value) * 1e-2d,
+ LuminanceUnit.DecicandelaPerSquareMeter => (_value) * 1e-1d,
+ LuminanceUnit.KilocandelaPerSquareMeter => (_value) * 1e3d,
+ LuminanceUnit.MicrocandelaPerSquareMeter => (_value) * 1e-6d,
+ LuminanceUnit.MillicandelaPerSquareMeter => (_value) * 1e-3d,
+ LuminanceUnit.NanocandelaPerSquareMeter => (_value) * 1e-9d,
+ LuminanceUnit.Nit => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LuminanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LuminanceUnit.CandelaPerSquareFoot => baseUnitValue * 9.290304e-2,
+ LuminanceUnit.CandelaPerSquareInch => baseUnitValue * 0.00064516,
+ LuminanceUnit.CandelaPerSquareMeter => baseUnitValue,
+ LuminanceUnit.CenticandelaPerSquareMeter => (baseUnitValue) / 1e-2d,
+ LuminanceUnit.DecicandelaPerSquareMeter => (baseUnitValue) / 1e-1d,
+ LuminanceUnit.KilocandelaPerSquareMeter => (baseUnitValue) / 1e3d,
+ LuminanceUnit.MicrocandelaPerSquareMeter => (baseUnitValue) / 1e-6d,
+ LuminanceUnit.MillicandelaPerSquareMeter => (baseUnitValue) / 1e-3d,
+ LuminanceUnit.NanocandelaPerSquareMeter => (baseUnitValue) / 1e-9d,
+ LuminanceUnit.Nit => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminosity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminosity.g.cs
index 2f8b1afb41..185aa5aa11 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminosity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Luminosity.g.cs
@@ -238,79 +238,79 @@ public static Luminosity From(double value, LuminosityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LuminosityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Luminosity to another Luminosity with the unit representation .
- ///
- /// A Luminosity with the specified unit.
- public Luminosity ToUnit(LuminosityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Luminosity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LuminosityUnit.Decawatt => (_value) * 1e1d,
- LuminosityUnit.Deciwatt => (_value) * 1e-1d,
- LuminosityUnit.Femtowatt => (_value) * 1e-15d,
- LuminosityUnit.Gigawatt => (_value) * 1e9d,
- LuminosityUnit.Kilowatt => (_value) * 1e3d,
- LuminosityUnit.Megawatt => (_value) * 1e6d,
- LuminosityUnit.Microwatt => (_value) * 1e-6d,
- LuminosityUnit.Milliwatt => (_value) * 1e-3d,
- LuminosityUnit.Nanowatt => (_value) * 1e-9d,
- LuminosityUnit.Petawatt => (_value) * 1e15d,
- LuminosityUnit.Picowatt => (_value) * 1e-12d,
- LuminosityUnit.SolarLuminosity => _value * 3.828e26,
- LuminosityUnit.Terawatt => (_value) * 1e12d,
- LuminosityUnit.Watt => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LuminosityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LuminosityUnit.Decawatt => (baseUnitValue) / 1e1d,
- LuminosityUnit.Deciwatt => (baseUnitValue) / 1e-1d,
- LuminosityUnit.Femtowatt => (baseUnitValue) / 1e-15d,
- LuminosityUnit.Gigawatt => (baseUnitValue) / 1e9d,
- LuminosityUnit.Kilowatt => (baseUnitValue) / 1e3d,
- LuminosityUnit.Megawatt => (baseUnitValue) / 1e6d,
- LuminosityUnit.Microwatt => (baseUnitValue) / 1e-6d,
- LuminosityUnit.Milliwatt => (baseUnitValue) / 1e-3d,
- LuminosityUnit.Nanowatt => (baseUnitValue) / 1e-9d,
- LuminosityUnit.Petawatt => (baseUnitValue) / 1e15d,
- LuminosityUnit.Picowatt => (baseUnitValue) / 1e-12d,
- LuminosityUnit.SolarLuminosity => baseUnitValue / 3.828e26,
- LuminosityUnit.Terawatt => (baseUnitValue) / 1e12d,
- LuminosityUnit.Watt => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LuminosityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Luminosity to another Luminosity with the unit representation .
+ ///
+ /// A Luminosity with the specified unit.
+ public Luminosity ToUnit(LuminosityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Luminosity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LuminosityUnit.Decawatt => (_value) * 1e1d,
+ LuminosityUnit.Deciwatt => (_value) * 1e-1d,
+ LuminosityUnit.Femtowatt => (_value) * 1e-15d,
+ LuminosityUnit.Gigawatt => (_value) * 1e9d,
+ LuminosityUnit.Kilowatt => (_value) * 1e3d,
+ LuminosityUnit.Megawatt => (_value) * 1e6d,
+ LuminosityUnit.Microwatt => (_value) * 1e-6d,
+ LuminosityUnit.Milliwatt => (_value) * 1e-3d,
+ LuminosityUnit.Nanowatt => (_value) * 1e-9d,
+ LuminosityUnit.Petawatt => (_value) * 1e15d,
+ LuminosityUnit.Picowatt => (_value) * 1e-12d,
+ LuminosityUnit.SolarLuminosity => _value * 3.828e26,
+ LuminosityUnit.Terawatt => (_value) * 1e12d,
+ LuminosityUnit.Watt => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LuminosityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LuminosityUnit.Decawatt => (baseUnitValue) / 1e1d,
+ LuminosityUnit.Deciwatt => (baseUnitValue) / 1e-1d,
+ LuminosityUnit.Femtowatt => (baseUnitValue) / 1e-15d,
+ LuminosityUnit.Gigawatt => (baseUnitValue) / 1e9d,
+ LuminosityUnit.Kilowatt => (baseUnitValue) / 1e3d,
+ LuminosityUnit.Megawatt => (baseUnitValue) / 1e6d,
+ LuminosityUnit.Microwatt => (baseUnitValue) / 1e-6d,
+ LuminosityUnit.Milliwatt => (baseUnitValue) / 1e-3d,
+ LuminosityUnit.Nanowatt => (baseUnitValue) / 1e-9d,
+ LuminosityUnit.Petawatt => (baseUnitValue) / 1e15d,
+ LuminosityUnit.Picowatt => (baseUnitValue) / 1e-12d,
+ LuminosityUnit.SolarLuminosity => baseUnitValue / 3.828e26,
+ LuminosityUnit.Terawatt => (baseUnitValue) / 1e12d,
+ LuminosityUnit.Watt => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousFlux.g.cs
index 22fcdd609f..39e525d7b0 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousFlux.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousFlux.g.cs
@@ -108,53 +108,53 @@ public static LuminousFlux From(double value, LuminousFluxUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LuminousFluxUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this LuminousFlux to another LuminousFlux with the unit representation .
- ///
- /// A LuminousFlux with the specified unit.
- public LuminousFlux ToUnit(LuminousFluxUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new LuminousFlux(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LuminousFluxUnit.Lumen => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LuminousFluxUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LuminousFluxUnit.Lumen => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LuminousFluxUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this LuminousFlux to another LuminousFlux with the unit representation .
+ ///
+ /// A LuminousFlux with the specified unit.
+ public LuminousFlux ToUnit(LuminousFluxUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new LuminousFlux(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LuminousFluxUnit.Lumen => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LuminousFluxUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LuminousFluxUnit.Lumen => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousIntensity.g.cs
index c60f66ac21..ac0a916692 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousIntensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/LuminousIntensity.g.cs
@@ -108,53 +108,53 @@ public static LuminousIntensity From(double value, LuminousIntensityUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(LuminousIntensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this LuminousIntensity to another LuminousIntensity with the unit representation .
- ///
- /// A LuminousIntensity with the specified unit.
- public LuminousIntensity ToUnit(LuminousIntensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new LuminousIntensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- LuminousIntensityUnit.Candela => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(LuminousIntensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- LuminousIntensityUnit.Candela => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(LuminousIntensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this LuminousIntensity to another LuminousIntensity with the unit representation .
+ ///
+ /// A LuminousIntensity with the specified unit.
+ public LuminousIntensity ToUnit(LuminousIntensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new LuminousIntensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ LuminousIntensityUnit.Candela => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(LuminousIntensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ LuminousIntensityUnit.Candela => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticField.g.cs
index 3548210139..2dc1c0509a 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticField.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticField.g.cs
@@ -158,63 +158,63 @@ public static MagneticField From(double value, MagneticFieldUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MagneticFieldUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MagneticField to another MagneticField with the unit representation .
- ///
- /// A MagneticField with the specified unit.
- public MagneticField ToUnit(MagneticFieldUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MagneticField(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MagneticFieldUnit.Gauss => _value / 1e4,
- MagneticFieldUnit.Microtesla => (_value) * 1e-6d,
- MagneticFieldUnit.Milligauss => (_value / 1e4) * 1e-3d,
- MagneticFieldUnit.Millitesla => (_value) * 1e-3d,
- MagneticFieldUnit.Nanotesla => (_value) * 1e-9d,
- MagneticFieldUnit.Tesla => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MagneticFieldUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MagneticFieldUnit.Gauss => baseUnitValue * 1e4,
- MagneticFieldUnit.Microtesla => (baseUnitValue) / 1e-6d,
- MagneticFieldUnit.Milligauss => (baseUnitValue * 1e4) / 1e-3d,
- MagneticFieldUnit.Millitesla => (baseUnitValue) / 1e-3d,
- MagneticFieldUnit.Nanotesla => (baseUnitValue) / 1e-9d,
- MagneticFieldUnit.Tesla => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MagneticFieldUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MagneticField to another MagneticField with the unit representation .
+ ///
+ /// A MagneticField with the specified unit.
+ public MagneticField ToUnit(MagneticFieldUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MagneticField(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MagneticFieldUnit.Gauss => _value / 1e4,
+ MagneticFieldUnit.Microtesla => (_value) * 1e-6d,
+ MagneticFieldUnit.Milligauss => (_value / 1e4) * 1e-3d,
+ MagneticFieldUnit.Millitesla => (_value) * 1e-3d,
+ MagneticFieldUnit.Nanotesla => (_value) * 1e-9d,
+ MagneticFieldUnit.Tesla => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MagneticFieldUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MagneticFieldUnit.Gauss => baseUnitValue * 1e4,
+ MagneticFieldUnit.Microtesla => (baseUnitValue) / 1e-6d,
+ MagneticFieldUnit.Milligauss => (baseUnitValue * 1e4) / 1e-3d,
+ MagneticFieldUnit.Millitesla => (baseUnitValue) / 1e-3d,
+ MagneticFieldUnit.Nanotesla => (baseUnitValue) / 1e-9d,
+ MagneticFieldUnit.Tesla => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticFlux.g.cs
index 03a5b66cd0..c5706060cf 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticFlux.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MagneticFlux.g.cs
@@ -108,53 +108,53 @@ public static MagneticFlux From(double value, MagneticFluxUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MagneticFluxUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MagneticFlux to another MagneticFlux with the unit representation .
- ///
- /// A MagneticFlux with the specified unit.
- public MagneticFlux ToUnit(MagneticFluxUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MagneticFlux(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MagneticFluxUnit.Weber => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MagneticFluxUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MagneticFluxUnit.Weber => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MagneticFluxUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MagneticFlux to another MagneticFlux with the unit representation .
+ ///
+ /// A MagneticFlux with the specified unit.
+ public MagneticFlux ToUnit(MagneticFluxUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MagneticFlux(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MagneticFluxUnit.Weber => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MagneticFluxUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MagneticFluxUnit.Weber => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Magnetization.g.cs
index 225c4b3b4f..9a0453c84a 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Magnetization.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Magnetization.g.cs
@@ -108,53 +108,53 @@ public static Magnetization From(double value, MagnetizationUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MagnetizationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Magnetization to another Magnetization with the unit representation .
- ///
- /// A Magnetization with the specified unit.
- public Magnetization ToUnit(MagnetizationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Magnetization(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MagnetizationUnit.AmperePerMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MagnetizationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MagnetizationUnit.AmperePerMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MagnetizationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Magnetization to another Magnetization with the unit representation .
+ ///
+ /// A Magnetization with the specified unit.
+ public Magnetization ToUnit(MagnetizationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Magnetization(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MagnetizationUnit.AmperePerMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MagnetizationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MagnetizationUnit.AmperePerMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Mass.g.cs
index 1da423950f..9e7c563853 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Mass.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Mass.g.cs
@@ -405,113 +405,113 @@ public static Mass From(double value, MassUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MassUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Mass to another Mass with the unit representation .
- ///
- /// A Mass with the specified unit.
- public Mass ToUnit(MassUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Mass(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MassUnit.Centigram => (_value / 1e3) * 1e-2d,
- MassUnit.Dalton => _value * 1.66053906660e-27,
- MassUnit.Decagram => (_value / 1e3) * 1e1d,
- MassUnit.Decigram => (_value / 1e3) * 1e-1d,
- MassUnit.EarthMass => _value * 5.9722E+24,
- MassUnit.Femtogram => (_value / 1e3) * 1e-15d,
- MassUnit.Gigadalton => (_value * 1.66053906660e-27) * 1e9d,
- MassUnit.Grain => _value * 64.79891e-6,
- MassUnit.Gram => _value / 1e3,
- MassUnit.Hectogram => (_value / 1e3) * 1e2d,
- MassUnit.Kilodalton => (_value * 1.66053906660e-27) * 1e3d,
- MassUnit.Kilogram => (_value / 1e3) * 1e3d,
- MassUnit.Kilopound => (_value * 0.45359237) * 1e3d,
- MassUnit.Kilotonne => (_value * 1e3) * 1e3d,
- MassUnit.LongHundredweight => _value * 50.80234544,
- MassUnit.LongTon => _value * 1016.0469088,
- MassUnit.Megadalton => (_value * 1.66053906660e-27) * 1e6d,
- MassUnit.Megapound => (_value * 0.45359237) * 1e6d,
- MassUnit.Megatonne => (_value * 1e3) * 1e6d,
- MassUnit.Microgram => (_value / 1e3) * 1e-6d,
- MassUnit.Milligram => (_value / 1e3) * 1e-3d,
- MassUnit.Nanogram => (_value / 1e3) * 1e-9d,
- MassUnit.Ounce => _value * 0.028349523125,
- MassUnit.Picogram => (_value / 1e3) * 1e-12d,
- MassUnit.Pound => _value * 0.45359237,
- MassUnit.ShortHundredweight => _value * 45.359237,
- MassUnit.ShortTon => _value * 907.18474,
- MassUnit.Slug => _value * 0.45359237 * 9.80665 / 0.3048,
- MassUnit.SolarMass => _value * 1.98947e30,
- MassUnit.Stone => _value * 6.35029318,
- MassUnit.Tonne => _value * 1e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MassUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MassUnit.Centigram => (baseUnitValue * 1e3) / 1e-2d,
- MassUnit.Dalton => baseUnitValue / 1.66053906660e-27,
- MassUnit.Decagram => (baseUnitValue * 1e3) / 1e1d,
- MassUnit.Decigram => (baseUnitValue * 1e3) / 1e-1d,
- MassUnit.EarthMass => baseUnitValue / 5.9722E+24,
- MassUnit.Femtogram => (baseUnitValue * 1e3) / 1e-15d,
- MassUnit.Gigadalton => (baseUnitValue / 1.66053906660e-27) / 1e9d,
- MassUnit.Grain => baseUnitValue / 64.79891e-6,
- MassUnit.Gram => baseUnitValue * 1e3,
- MassUnit.Hectogram => (baseUnitValue * 1e3) / 1e2d,
- MassUnit.Kilodalton => (baseUnitValue / 1.66053906660e-27) / 1e3d,
- MassUnit.Kilogram => (baseUnitValue * 1e3) / 1e3d,
- MassUnit.Kilopound => (baseUnitValue / 0.45359237) / 1e3d,
- MassUnit.Kilotonne => (baseUnitValue / 1e3) / 1e3d,
- MassUnit.LongHundredweight => baseUnitValue / 50.80234544,
- MassUnit.LongTon => baseUnitValue / 1016.0469088,
- MassUnit.Megadalton => (baseUnitValue / 1.66053906660e-27) / 1e6d,
- MassUnit.Megapound => (baseUnitValue / 0.45359237) / 1e6d,
- MassUnit.Megatonne => (baseUnitValue / 1e3) / 1e6d,
- MassUnit.Microgram => (baseUnitValue * 1e3) / 1e-6d,
- MassUnit.Milligram => (baseUnitValue * 1e3) / 1e-3d,
- MassUnit.Nanogram => (baseUnitValue * 1e3) / 1e-9d,
- MassUnit.Ounce => baseUnitValue / 0.028349523125,
- MassUnit.Picogram => (baseUnitValue * 1e3) / 1e-12d,
- MassUnit.Pound => baseUnitValue / 0.45359237,
- MassUnit.ShortHundredweight => baseUnitValue / 45.359237,
- MassUnit.ShortTon => baseUnitValue / 907.18474,
- MassUnit.Slug => baseUnitValue * 0.3048 / (0.45359237 * 9.80665),
- MassUnit.SolarMass => baseUnitValue / 1.98947e30,
- MassUnit.Stone => baseUnitValue / 6.35029318,
- MassUnit.Tonne => baseUnitValue / 1e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MassUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Mass to another Mass with the unit representation .
+ ///
+ /// A Mass with the specified unit.
+ public Mass ToUnit(MassUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Mass(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MassUnit.Centigram => (_value / 1e3) * 1e-2d,
+ MassUnit.Dalton => _value * 1.66053906660e-27,
+ MassUnit.Decagram => (_value / 1e3) * 1e1d,
+ MassUnit.Decigram => (_value / 1e3) * 1e-1d,
+ MassUnit.EarthMass => _value * 5.9722E+24,
+ MassUnit.Femtogram => (_value / 1e3) * 1e-15d,
+ MassUnit.Gigadalton => (_value * 1.66053906660e-27) * 1e9d,
+ MassUnit.Grain => _value * 64.79891e-6,
+ MassUnit.Gram => _value / 1e3,
+ MassUnit.Hectogram => (_value / 1e3) * 1e2d,
+ MassUnit.Kilodalton => (_value * 1.66053906660e-27) * 1e3d,
+ MassUnit.Kilogram => (_value / 1e3) * 1e3d,
+ MassUnit.Kilopound => (_value * 0.45359237) * 1e3d,
+ MassUnit.Kilotonne => (_value * 1e3) * 1e3d,
+ MassUnit.LongHundredweight => _value * 50.80234544,
+ MassUnit.LongTon => _value * 1016.0469088,
+ MassUnit.Megadalton => (_value * 1.66053906660e-27) * 1e6d,
+ MassUnit.Megapound => (_value * 0.45359237) * 1e6d,
+ MassUnit.Megatonne => (_value * 1e3) * 1e6d,
+ MassUnit.Microgram => (_value / 1e3) * 1e-6d,
+ MassUnit.Milligram => (_value / 1e3) * 1e-3d,
+ MassUnit.Nanogram => (_value / 1e3) * 1e-9d,
+ MassUnit.Ounce => _value * 0.028349523125,
+ MassUnit.Picogram => (_value / 1e3) * 1e-12d,
+ MassUnit.Pound => _value * 0.45359237,
+ MassUnit.ShortHundredweight => _value * 45.359237,
+ MassUnit.ShortTon => _value * 907.18474,
+ MassUnit.Slug => _value * 0.45359237 * 9.80665 / 0.3048,
+ MassUnit.SolarMass => _value * 1.98947e30,
+ MassUnit.Stone => _value * 6.35029318,
+ MassUnit.Tonne => _value * 1e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MassUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MassUnit.Centigram => (baseUnitValue * 1e3) / 1e-2d,
+ MassUnit.Dalton => baseUnitValue / 1.66053906660e-27,
+ MassUnit.Decagram => (baseUnitValue * 1e3) / 1e1d,
+ MassUnit.Decigram => (baseUnitValue * 1e3) / 1e-1d,
+ MassUnit.EarthMass => baseUnitValue / 5.9722E+24,
+ MassUnit.Femtogram => (baseUnitValue * 1e3) / 1e-15d,
+ MassUnit.Gigadalton => (baseUnitValue / 1.66053906660e-27) / 1e9d,
+ MassUnit.Grain => baseUnitValue / 64.79891e-6,
+ MassUnit.Gram => baseUnitValue * 1e3,
+ MassUnit.Hectogram => (baseUnitValue * 1e3) / 1e2d,
+ MassUnit.Kilodalton => (baseUnitValue / 1.66053906660e-27) / 1e3d,
+ MassUnit.Kilogram => (baseUnitValue * 1e3) / 1e3d,
+ MassUnit.Kilopound => (baseUnitValue / 0.45359237) / 1e3d,
+ MassUnit.Kilotonne => (baseUnitValue / 1e3) / 1e3d,
+ MassUnit.LongHundredweight => baseUnitValue / 50.80234544,
+ MassUnit.LongTon => baseUnitValue / 1016.0469088,
+ MassUnit.Megadalton => (baseUnitValue / 1.66053906660e-27) / 1e6d,
+ MassUnit.Megapound => (baseUnitValue / 0.45359237) / 1e6d,
+ MassUnit.Megatonne => (baseUnitValue / 1e3) / 1e6d,
+ MassUnit.Microgram => (baseUnitValue * 1e3) / 1e-6d,
+ MassUnit.Milligram => (baseUnitValue * 1e3) / 1e-3d,
+ MassUnit.Nanogram => (baseUnitValue * 1e3) / 1e-9d,
+ MassUnit.Ounce => baseUnitValue / 0.028349523125,
+ MassUnit.Picogram => (baseUnitValue * 1e3) / 1e-12d,
+ MassUnit.Pound => baseUnitValue / 0.45359237,
+ MassUnit.ShortHundredweight => baseUnitValue / 45.359237,
+ MassUnit.ShortTon => baseUnitValue / 907.18474,
+ MassUnit.Slug => baseUnitValue * 0.3048 / (0.45359237 * 9.80665),
+ MassUnit.SolarMass => baseUnitValue / 1.98947e30,
+ MassUnit.Stone => baseUnitValue / 6.35029318,
+ MassUnit.Tonne => baseUnitValue / 1e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassConcentration.g.cs
index 3ef7bf6e66..ccbb623f16 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassConcentration.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassConcentration.g.cs
@@ -588,149 +588,149 @@ public static MassConcentration From(double value, MassConcentrationUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MassConcentrationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MassConcentration to another MassConcentration with the unit representation .
- ///
- /// A MassConcentration with the specified unit.
- public MassConcentration ToUnit(MassConcentrationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MassConcentration(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MassConcentrationUnit.CentigramPerDeciliter => (_value / 1e-1) * 1e-2d,
- MassConcentrationUnit.CentigramPerLiter => (_value) * 1e-2d,
- MassConcentrationUnit.CentigramPerMicroliter => (_value / 1e-6) * 1e-2d,
- MassConcentrationUnit.CentigramPerMilliliter => (_value / 1e-3) * 1e-2d,
- MassConcentrationUnit.DecigramPerDeciliter => (_value / 1e-1) * 1e-1d,
- MassConcentrationUnit.DecigramPerLiter => (_value) * 1e-1d,
- MassConcentrationUnit.DecigramPerMicroliter => (_value / 1e-6) * 1e-1d,
- MassConcentrationUnit.DecigramPerMilliliter => (_value / 1e-3) * 1e-1d,
- MassConcentrationUnit.GramPerCubicCentimeter => _value / 1e-3,
- MassConcentrationUnit.GramPerCubicMeter => _value / 1e3,
- MassConcentrationUnit.GramPerCubicMillimeter => _value / 1e-6,
- MassConcentrationUnit.GramPerDeciliter => _value / 1e-1,
- MassConcentrationUnit.GramPerLiter => _value,
- MassConcentrationUnit.GramPerMicroliter => _value / 1e-6,
- MassConcentrationUnit.GramPerMilliliter => _value / 1e-3,
- MassConcentrationUnit.KilogramPerCubicCentimeter => (_value / 1e-3) * 1e3d,
- MassConcentrationUnit.KilogramPerCubicMeter => (_value / 1e3) * 1e3d,
- MassConcentrationUnit.KilogramPerCubicMillimeter => (_value / 1e-6) * 1e3d,
- MassConcentrationUnit.KilogramPerLiter => (_value) * 1e3d,
- MassConcentrationUnit.KilopoundPerCubicFoot => (_value * 0.45359237 / 0.028316846592) * 1e3d,
- MassConcentrationUnit.KilopoundPerCubicInch => (_value * 0.45359237 / 1.6387064e-5) * 1e3d,
- MassConcentrationUnit.MicrogramPerCubicMeter => (_value / 1e3) * 1e-6d,
- MassConcentrationUnit.MicrogramPerDeciliter => (_value / 1e-1) * 1e-6d,
- MassConcentrationUnit.MicrogramPerLiter => (_value) * 1e-6d,
- MassConcentrationUnit.MicrogramPerMicroliter => (_value / 1e-6) * 1e-6d,
- MassConcentrationUnit.MicrogramPerMilliliter => (_value / 1e-3) * 1e-6d,
- MassConcentrationUnit.MilligramPerCubicMeter => (_value / 1e3) * 1e-3d,
- MassConcentrationUnit.MilligramPerDeciliter => (_value / 1e-1) * 1e-3d,
- MassConcentrationUnit.MilligramPerLiter => (_value) * 1e-3d,
- MassConcentrationUnit.MilligramPerMicroliter => (_value / 1e-6) * 1e-3d,
- MassConcentrationUnit.MilligramPerMilliliter => (_value / 1e-3) * 1e-3d,
- MassConcentrationUnit.NanogramPerDeciliter => (_value / 1e-1) * 1e-9d,
- MassConcentrationUnit.NanogramPerLiter => (_value) * 1e-9d,
- MassConcentrationUnit.NanogramPerMicroliter => (_value / 1e-6) * 1e-9d,
- MassConcentrationUnit.NanogramPerMilliliter => (_value / 1e-3) * 1e-9d,
- MassConcentrationUnit.OuncePerImperialGallon => _value * 0.028349523125 / 0.00454609,
- MassConcentrationUnit.OuncePerUSGallon => _value * 0.028349523125 / 0.003785411784,
- MassConcentrationUnit.PicogramPerDeciliter => (_value / 1e-1) * 1e-12d,
- MassConcentrationUnit.PicogramPerLiter => (_value) * 1e-12d,
- MassConcentrationUnit.PicogramPerMicroliter => (_value / 1e-6) * 1e-12d,
- MassConcentrationUnit.PicogramPerMilliliter => (_value / 1e-3) * 1e-12d,
- MassConcentrationUnit.PoundPerCubicFoot => _value * 0.45359237 / 0.028316846592,
- MassConcentrationUnit.PoundPerCubicInch => _value * 0.45359237 / 1.6387064e-5,
- MassConcentrationUnit.PoundPerImperialGallon => _value * 0.45359237 / 0.00454609,
- MassConcentrationUnit.PoundPerUSGallon => _value * 0.45359237 / 0.003785411784,
- MassConcentrationUnit.SlugPerCubicFoot => _value * (0.45359237 * 9.80665) / (0.3048 * 0.028316846592),
- MassConcentrationUnit.TonnePerCubicCentimeter => _value / 1e-9,
- MassConcentrationUnit.TonnePerCubicMeter => _value / 0.001,
- MassConcentrationUnit.TonnePerCubicMillimeter => _value / 1e-12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MassConcentrationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MassConcentrationUnit.CentigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-2d,
- MassConcentrationUnit.CentigramPerLiter => (baseUnitValue) / 1e-2d,
- MassConcentrationUnit.CentigramPerMicroliter => (baseUnitValue * 1e-6) / 1e-2d,
- MassConcentrationUnit.CentigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-2d,
- MassConcentrationUnit.DecigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-1d,
- MassConcentrationUnit.DecigramPerLiter => (baseUnitValue) / 1e-1d,
- MassConcentrationUnit.DecigramPerMicroliter => (baseUnitValue * 1e-6) / 1e-1d,
- MassConcentrationUnit.DecigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-1d,
- MassConcentrationUnit.GramPerCubicCentimeter => baseUnitValue * 1e-3,
- MassConcentrationUnit.GramPerCubicMeter => baseUnitValue * 1e3,
- MassConcentrationUnit.GramPerCubicMillimeter => baseUnitValue * 1e-6,
- MassConcentrationUnit.GramPerDeciliter => baseUnitValue * 1e-1,
- MassConcentrationUnit.GramPerLiter => baseUnitValue,
- MassConcentrationUnit.GramPerMicroliter => baseUnitValue * 1e-6,
- MassConcentrationUnit.GramPerMilliliter => baseUnitValue * 1e-3,
- MassConcentrationUnit.KilogramPerCubicCentimeter => (baseUnitValue * 1e-3) / 1e3d,
- MassConcentrationUnit.KilogramPerCubicMeter => (baseUnitValue * 1e3) / 1e3d,
- MassConcentrationUnit.KilogramPerCubicMillimeter => (baseUnitValue * 1e-6) / 1e3d,
- MassConcentrationUnit.KilogramPerLiter => (baseUnitValue) / 1e3d,
- MassConcentrationUnit.KilopoundPerCubicFoot => (baseUnitValue * 0.028316846592 / 0.45359237) / 1e3d,
- MassConcentrationUnit.KilopoundPerCubicInch => (baseUnitValue * 1.6387064e-5 / 0.45359237) / 1e3d,
- MassConcentrationUnit.MicrogramPerCubicMeter => (baseUnitValue * 1e3) / 1e-6d,
- MassConcentrationUnit.MicrogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-6d,
- MassConcentrationUnit.MicrogramPerLiter => (baseUnitValue) / 1e-6d,
- MassConcentrationUnit.MicrogramPerMicroliter => (baseUnitValue * 1e-6) / 1e-6d,
- MassConcentrationUnit.MicrogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-6d,
- MassConcentrationUnit.MilligramPerCubicMeter => (baseUnitValue * 1e3) / 1e-3d,
- MassConcentrationUnit.MilligramPerDeciliter => (baseUnitValue * 1e-1) / 1e-3d,
- MassConcentrationUnit.MilligramPerLiter => (baseUnitValue) / 1e-3d,
- MassConcentrationUnit.MilligramPerMicroliter => (baseUnitValue * 1e-6) / 1e-3d,
- MassConcentrationUnit.MilligramPerMilliliter => (baseUnitValue * 1e-3) / 1e-3d,
- MassConcentrationUnit.NanogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-9d,
- MassConcentrationUnit.NanogramPerLiter => (baseUnitValue) / 1e-9d,
- MassConcentrationUnit.NanogramPerMicroliter => (baseUnitValue * 1e-6) / 1e-9d,
- MassConcentrationUnit.NanogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-9d,
- MassConcentrationUnit.OuncePerImperialGallon => baseUnitValue * 0.00454609 / 0.028349523125,
- MassConcentrationUnit.OuncePerUSGallon => baseUnitValue * 0.003785411784 / 0.028349523125,
- MassConcentrationUnit.PicogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-12d,
- MassConcentrationUnit.PicogramPerLiter => (baseUnitValue) / 1e-12d,
- MassConcentrationUnit.PicogramPerMicroliter => (baseUnitValue * 1e-6) / 1e-12d,
- MassConcentrationUnit.PicogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-12d,
- MassConcentrationUnit.PoundPerCubicFoot => baseUnitValue * 0.028316846592 / 0.45359237,
- MassConcentrationUnit.PoundPerCubicInch => baseUnitValue * 1.6387064e-5 / 0.45359237,
- MassConcentrationUnit.PoundPerImperialGallon => baseUnitValue * 0.00454609 / 0.45359237,
- MassConcentrationUnit.PoundPerUSGallon => baseUnitValue * 0.003785411784 / 0.45359237,
- MassConcentrationUnit.SlugPerCubicFoot => baseUnitValue * (0.3048 * 0.028316846592) / (0.45359237 * 9.80665),
- MassConcentrationUnit.TonnePerCubicCentimeter => baseUnitValue * 1e-9,
- MassConcentrationUnit.TonnePerCubicMeter => baseUnitValue * 0.001,
- MassConcentrationUnit.TonnePerCubicMillimeter => baseUnitValue * 1e-12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MassConcentrationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MassConcentration to another MassConcentration with the unit representation .
+ ///
+ /// A MassConcentration with the specified unit.
+ public MassConcentration ToUnit(MassConcentrationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MassConcentration(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MassConcentrationUnit.CentigramPerDeciliter => (_value / 1e-1) * 1e-2d,
+ MassConcentrationUnit.CentigramPerLiter => (_value) * 1e-2d,
+ MassConcentrationUnit.CentigramPerMicroliter => (_value / 1e-6) * 1e-2d,
+ MassConcentrationUnit.CentigramPerMilliliter => (_value / 1e-3) * 1e-2d,
+ MassConcentrationUnit.DecigramPerDeciliter => (_value / 1e-1) * 1e-1d,
+ MassConcentrationUnit.DecigramPerLiter => (_value) * 1e-1d,
+ MassConcentrationUnit.DecigramPerMicroliter => (_value / 1e-6) * 1e-1d,
+ MassConcentrationUnit.DecigramPerMilliliter => (_value / 1e-3) * 1e-1d,
+ MassConcentrationUnit.GramPerCubicCentimeter => _value / 1e-3,
+ MassConcentrationUnit.GramPerCubicMeter => _value / 1e3,
+ MassConcentrationUnit.GramPerCubicMillimeter => _value / 1e-6,
+ MassConcentrationUnit.GramPerDeciliter => _value / 1e-1,
+ MassConcentrationUnit.GramPerLiter => _value,
+ MassConcentrationUnit.GramPerMicroliter => _value / 1e-6,
+ MassConcentrationUnit.GramPerMilliliter => _value / 1e-3,
+ MassConcentrationUnit.KilogramPerCubicCentimeter => (_value / 1e-3) * 1e3d,
+ MassConcentrationUnit.KilogramPerCubicMeter => (_value / 1e3) * 1e3d,
+ MassConcentrationUnit.KilogramPerCubicMillimeter => (_value / 1e-6) * 1e3d,
+ MassConcentrationUnit.KilogramPerLiter => (_value) * 1e3d,
+ MassConcentrationUnit.KilopoundPerCubicFoot => (_value * 0.45359237 / 0.028316846592) * 1e3d,
+ MassConcentrationUnit.KilopoundPerCubicInch => (_value * 0.45359237 / 1.6387064e-5) * 1e3d,
+ MassConcentrationUnit.MicrogramPerCubicMeter => (_value / 1e3) * 1e-6d,
+ MassConcentrationUnit.MicrogramPerDeciliter => (_value / 1e-1) * 1e-6d,
+ MassConcentrationUnit.MicrogramPerLiter => (_value) * 1e-6d,
+ MassConcentrationUnit.MicrogramPerMicroliter => (_value / 1e-6) * 1e-6d,
+ MassConcentrationUnit.MicrogramPerMilliliter => (_value / 1e-3) * 1e-6d,
+ MassConcentrationUnit.MilligramPerCubicMeter => (_value / 1e3) * 1e-3d,
+ MassConcentrationUnit.MilligramPerDeciliter => (_value / 1e-1) * 1e-3d,
+ MassConcentrationUnit.MilligramPerLiter => (_value) * 1e-3d,
+ MassConcentrationUnit.MilligramPerMicroliter => (_value / 1e-6) * 1e-3d,
+ MassConcentrationUnit.MilligramPerMilliliter => (_value / 1e-3) * 1e-3d,
+ MassConcentrationUnit.NanogramPerDeciliter => (_value / 1e-1) * 1e-9d,
+ MassConcentrationUnit.NanogramPerLiter => (_value) * 1e-9d,
+ MassConcentrationUnit.NanogramPerMicroliter => (_value / 1e-6) * 1e-9d,
+ MassConcentrationUnit.NanogramPerMilliliter => (_value / 1e-3) * 1e-9d,
+ MassConcentrationUnit.OuncePerImperialGallon => _value * 0.028349523125 / 0.00454609,
+ MassConcentrationUnit.OuncePerUSGallon => _value * 0.028349523125 / 0.003785411784,
+ MassConcentrationUnit.PicogramPerDeciliter => (_value / 1e-1) * 1e-12d,
+ MassConcentrationUnit.PicogramPerLiter => (_value) * 1e-12d,
+ MassConcentrationUnit.PicogramPerMicroliter => (_value / 1e-6) * 1e-12d,
+ MassConcentrationUnit.PicogramPerMilliliter => (_value / 1e-3) * 1e-12d,
+ MassConcentrationUnit.PoundPerCubicFoot => _value * 0.45359237 / 0.028316846592,
+ MassConcentrationUnit.PoundPerCubicInch => _value * 0.45359237 / 1.6387064e-5,
+ MassConcentrationUnit.PoundPerImperialGallon => _value * 0.45359237 / 0.00454609,
+ MassConcentrationUnit.PoundPerUSGallon => _value * 0.45359237 / 0.003785411784,
+ MassConcentrationUnit.SlugPerCubicFoot => _value * (0.45359237 * 9.80665) / (0.3048 * 0.028316846592),
+ MassConcentrationUnit.TonnePerCubicCentimeter => _value / 1e-9,
+ MassConcentrationUnit.TonnePerCubicMeter => _value / 0.001,
+ MassConcentrationUnit.TonnePerCubicMillimeter => _value / 1e-12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MassConcentrationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MassConcentrationUnit.CentigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-2d,
+ MassConcentrationUnit.CentigramPerLiter => (baseUnitValue) / 1e-2d,
+ MassConcentrationUnit.CentigramPerMicroliter => (baseUnitValue * 1e-6) / 1e-2d,
+ MassConcentrationUnit.CentigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-2d,
+ MassConcentrationUnit.DecigramPerDeciliter => (baseUnitValue * 1e-1) / 1e-1d,
+ MassConcentrationUnit.DecigramPerLiter => (baseUnitValue) / 1e-1d,
+ MassConcentrationUnit.DecigramPerMicroliter => (baseUnitValue * 1e-6) / 1e-1d,
+ MassConcentrationUnit.DecigramPerMilliliter => (baseUnitValue * 1e-3) / 1e-1d,
+ MassConcentrationUnit.GramPerCubicCentimeter => baseUnitValue * 1e-3,
+ MassConcentrationUnit.GramPerCubicMeter => baseUnitValue * 1e3,
+ MassConcentrationUnit.GramPerCubicMillimeter => baseUnitValue * 1e-6,
+ MassConcentrationUnit.GramPerDeciliter => baseUnitValue * 1e-1,
+ MassConcentrationUnit.GramPerLiter => baseUnitValue,
+ MassConcentrationUnit.GramPerMicroliter => baseUnitValue * 1e-6,
+ MassConcentrationUnit.GramPerMilliliter => baseUnitValue * 1e-3,
+ MassConcentrationUnit.KilogramPerCubicCentimeter => (baseUnitValue * 1e-3) / 1e3d,
+ MassConcentrationUnit.KilogramPerCubicMeter => (baseUnitValue * 1e3) / 1e3d,
+ MassConcentrationUnit.KilogramPerCubicMillimeter => (baseUnitValue * 1e-6) / 1e3d,
+ MassConcentrationUnit.KilogramPerLiter => (baseUnitValue) / 1e3d,
+ MassConcentrationUnit.KilopoundPerCubicFoot => (baseUnitValue * 0.028316846592 / 0.45359237) / 1e3d,
+ MassConcentrationUnit.KilopoundPerCubicInch => (baseUnitValue * 1.6387064e-5 / 0.45359237) / 1e3d,
+ MassConcentrationUnit.MicrogramPerCubicMeter => (baseUnitValue * 1e3) / 1e-6d,
+ MassConcentrationUnit.MicrogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-6d,
+ MassConcentrationUnit.MicrogramPerLiter => (baseUnitValue) / 1e-6d,
+ MassConcentrationUnit.MicrogramPerMicroliter => (baseUnitValue * 1e-6) / 1e-6d,
+ MassConcentrationUnit.MicrogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-6d,
+ MassConcentrationUnit.MilligramPerCubicMeter => (baseUnitValue * 1e3) / 1e-3d,
+ MassConcentrationUnit.MilligramPerDeciliter => (baseUnitValue * 1e-1) / 1e-3d,
+ MassConcentrationUnit.MilligramPerLiter => (baseUnitValue) / 1e-3d,
+ MassConcentrationUnit.MilligramPerMicroliter => (baseUnitValue * 1e-6) / 1e-3d,
+ MassConcentrationUnit.MilligramPerMilliliter => (baseUnitValue * 1e-3) / 1e-3d,
+ MassConcentrationUnit.NanogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-9d,
+ MassConcentrationUnit.NanogramPerLiter => (baseUnitValue) / 1e-9d,
+ MassConcentrationUnit.NanogramPerMicroliter => (baseUnitValue * 1e-6) / 1e-9d,
+ MassConcentrationUnit.NanogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-9d,
+ MassConcentrationUnit.OuncePerImperialGallon => baseUnitValue * 0.00454609 / 0.028349523125,
+ MassConcentrationUnit.OuncePerUSGallon => baseUnitValue * 0.003785411784 / 0.028349523125,
+ MassConcentrationUnit.PicogramPerDeciliter => (baseUnitValue * 1e-1) / 1e-12d,
+ MassConcentrationUnit.PicogramPerLiter => (baseUnitValue) / 1e-12d,
+ MassConcentrationUnit.PicogramPerMicroliter => (baseUnitValue * 1e-6) / 1e-12d,
+ MassConcentrationUnit.PicogramPerMilliliter => (baseUnitValue * 1e-3) / 1e-12d,
+ MassConcentrationUnit.PoundPerCubicFoot => baseUnitValue * 0.028316846592 / 0.45359237,
+ MassConcentrationUnit.PoundPerCubicInch => baseUnitValue * 1.6387064e-5 / 0.45359237,
+ MassConcentrationUnit.PoundPerImperialGallon => baseUnitValue * 0.00454609 / 0.45359237,
+ MassConcentrationUnit.PoundPerUSGallon => baseUnitValue * 0.003785411784 / 0.45359237,
+ MassConcentrationUnit.SlugPerCubicFoot => baseUnitValue * (0.3048 * 0.028316846592) / (0.45359237 * 9.80665),
+ MassConcentrationUnit.TonnePerCubicCentimeter => baseUnitValue * 1e-9,
+ MassConcentrationUnit.TonnePerCubicMeter => baseUnitValue * 0.001,
+ MassConcentrationUnit.TonnePerCubicMillimeter => baseUnitValue * 1e-12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlow.g.cs
index d6812a6347..a99c4b8220 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlow.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlow.g.cs
@@ -425,117 +425,117 @@ public static MassFlow From(double value, MassFlowUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MassFlowUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MassFlow to another MassFlow with the unit representation .
- ///
- /// A MassFlow with the specified unit.
- public MassFlow ToUnit(MassFlowUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MassFlow(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MassFlowUnit.CentigramPerDay => (_value / 86400) * 1e-2d,
- MassFlowUnit.CentigramPerSecond => (_value) * 1e-2d,
- MassFlowUnit.DecagramPerDay => (_value / 86400) * 1e1d,
- MassFlowUnit.DecagramPerSecond => (_value) * 1e1d,
- MassFlowUnit.DecigramPerDay => (_value / 86400) * 1e-1d,
- MassFlowUnit.DecigramPerSecond => (_value) * 1e-1d,
- MassFlowUnit.GramPerDay => _value / 86400,
- MassFlowUnit.GramPerHour => _value / 3600,
- MassFlowUnit.GramPerSecond => _value,
- MassFlowUnit.HectogramPerDay => (_value / 86400) * 1e2d,
- MassFlowUnit.HectogramPerSecond => (_value) * 1e2d,
- MassFlowUnit.KilogramPerDay => (_value / 86400) * 1e3d,
- MassFlowUnit.KilogramPerHour => _value / 3.6,
- MassFlowUnit.KilogramPerMinute => _value / 0.06,
- MassFlowUnit.KilogramPerSecond => (_value) * 1e3d,
- MassFlowUnit.MegagramPerDay => (_value / 86400) * 1e6d,
- MassFlowUnit.MegapoundPerDay => (_value * 453.59237 / 86400) * 1e6d,
- MassFlowUnit.MegapoundPerHour => (_value * 453.59237 / 3600) * 1e6d,
- MassFlowUnit.MegapoundPerMinute => (_value * 453.59237 / 60) * 1e6d,
- MassFlowUnit.MegapoundPerSecond => (_value * 453.59237) * 1e6d,
- MassFlowUnit.MicrogramPerDay => (_value / 86400) * 1e-6d,
- MassFlowUnit.MicrogramPerSecond => (_value) * 1e-6d,
- MassFlowUnit.MilligramPerDay => (_value / 86400) * 1e-3d,
- MassFlowUnit.MilligramPerSecond => (_value) * 1e-3d,
- MassFlowUnit.NanogramPerDay => (_value / 86400) * 1e-9d,
- MassFlowUnit.NanogramPerSecond => (_value) * 1e-9d,
- MassFlowUnit.PoundPerDay => _value * 453.59237 / 86400,
- MassFlowUnit.PoundPerHour => _value * 453.59237 / 3600,
- MassFlowUnit.PoundPerMinute => _value * 453.59237 / 60,
- MassFlowUnit.PoundPerSecond => _value * 453.59237,
- MassFlowUnit.ShortTonPerHour => _value * 907.18474 / 3.6,
- MassFlowUnit.TonnePerDay => _value / 0.0864000,
- MassFlowUnit.TonnePerHour => _value * 1000 / 3.6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MassFlowUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MassFlowUnit.CentigramPerDay => (baseUnitValue * 86400) / 1e-2d,
- MassFlowUnit.CentigramPerSecond => (baseUnitValue) / 1e-2d,
- MassFlowUnit.DecagramPerDay => (baseUnitValue * 86400) / 1e1d,
- MassFlowUnit.DecagramPerSecond => (baseUnitValue) / 1e1d,
- MassFlowUnit.DecigramPerDay => (baseUnitValue * 86400) / 1e-1d,
- MassFlowUnit.DecigramPerSecond => (baseUnitValue) / 1e-1d,
- MassFlowUnit.GramPerDay => baseUnitValue * 86400,
- MassFlowUnit.GramPerHour => baseUnitValue * 3600,
- MassFlowUnit.GramPerSecond => baseUnitValue,
- MassFlowUnit.HectogramPerDay => (baseUnitValue * 86400) / 1e2d,
- MassFlowUnit.HectogramPerSecond => (baseUnitValue) / 1e2d,
- MassFlowUnit.KilogramPerDay => (baseUnitValue * 86400) / 1e3d,
- MassFlowUnit.KilogramPerHour => baseUnitValue * 3.6,
- MassFlowUnit.KilogramPerMinute => baseUnitValue * 0.06,
- MassFlowUnit.KilogramPerSecond => (baseUnitValue) / 1e3d,
- MassFlowUnit.MegagramPerDay => (baseUnitValue * 86400) / 1e6d,
- MassFlowUnit.MegapoundPerDay => (baseUnitValue * 86400 / 453.59237) / 1e6d,
- MassFlowUnit.MegapoundPerHour => (baseUnitValue * 3600 / 453.59237) / 1e6d,
- MassFlowUnit.MegapoundPerMinute => (baseUnitValue * 60 / 453.59237) / 1e6d,
- MassFlowUnit.MegapoundPerSecond => (baseUnitValue / 453.59237) / 1e6d,
- MassFlowUnit.MicrogramPerDay => (baseUnitValue * 86400) / 1e-6d,
- MassFlowUnit.MicrogramPerSecond => (baseUnitValue) / 1e-6d,
- MassFlowUnit.MilligramPerDay => (baseUnitValue * 86400) / 1e-3d,
- MassFlowUnit.MilligramPerSecond => (baseUnitValue) / 1e-3d,
- MassFlowUnit.NanogramPerDay => (baseUnitValue * 86400) / 1e-9d,
- MassFlowUnit.NanogramPerSecond => (baseUnitValue) / 1e-9d,
- MassFlowUnit.PoundPerDay => baseUnitValue * 86400 / 453.59237,
- MassFlowUnit.PoundPerHour => baseUnitValue * 3600 / 453.59237,
- MassFlowUnit.PoundPerMinute => baseUnitValue * 60 / 453.59237,
- MassFlowUnit.PoundPerSecond => baseUnitValue / 453.59237,
- MassFlowUnit.ShortTonPerHour => baseUnitValue * 3.6 / 907.18474,
- MassFlowUnit.TonnePerDay => baseUnitValue * 0.0864000,
- MassFlowUnit.TonnePerHour => baseUnitValue * 3.6 / 1000,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MassFlowUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MassFlow to another MassFlow with the unit representation .
+ ///
+ /// A MassFlow with the specified unit.
+ public MassFlow ToUnit(MassFlowUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MassFlow(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MassFlowUnit.CentigramPerDay => (_value / 86400) * 1e-2d,
+ MassFlowUnit.CentigramPerSecond => (_value) * 1e-2d,
+ MassFlowUnit.DecagramPerDay => (_value / 86400) * 1e1d,
+ MassFlowUnit.DecagramPerSecond => (_value) * 1e1d,
+ MassFlowUnit.DecigramPerDay => (_value / 86400) * 1e-1d,
+ MassFlowUnit.DecigramPerSecond => (_value) * 1e-1d,
+ MassFlowUnit.GramPerDay => _value / 86400,
+ MassFlowUnit.GramPerHour => _value / 3600,
+ MassFlowUnit.GramPerSecond => _value,
+ MassFlowUnit.HectogramPerDay => (_value / 86400) * 1e2d,
+ MassFlowUnit.HectogramPerSecond => (_value) * 1e2d,
+ MassFlowUnit.KilogramPerDay => (_value / 86400) * 1e3d,
+ MassFlowUnit.KilogramPerHour => _value / 3.6,
+ MassFlowUnit.KilogramPerMinute => _value / 0.06,
+ MassFlowUnit.KilogramPerSecond => (_value) * 1e3d,
+ MassFlowUnit.MegagramPerDay => (_value / 86400) * 1e6d,
+ MassFlowUnit.MegapoundPerDay => (_value * 453.59237 / 86400) * 1e6d,
+ MassFlowUnit.MegapoundPerHour => (_value * 453.59237 / 3600) * 1e6d,
+ MassFlowUnit.MegapoundPerMinute => (_value * 453.59237 / 60) * 1e6d,
+ MassFlowUnit.MegapoundPerSecond => (_value * 453.59237) * 1e6d,
+ MassFlowUnit.MicrogramPerDay => (_value / 86400) * 1e-6d,
+ MassFlowUnit.MicrogramPerSecond => (_value) * 1e-6d,
+ MassFlowUnit.MilligramPerDay => (_value / 86400) * 1e-3d,
+ MassFlowUnit.MilligramPerSecond => (_value) * 1e-3d,
+ MassFlowUnit.NanogramPerDay => (_value / 86400) * 1e-9d,
+ MassFlowUnit.NanogramPerSecond => (_value) * 1e-9d,
+ MassFlowUnit.PoundPerDay => _value * 453.59237 / 86400,
+ MassFlowUnit.PoundPerHour => _value * 453.59237 / 3600,
+ MassFlowUnit.PoundPerMinute => _value * 453.59237 / 60,
+ MassFlowUnit.PoundPerSecond => _value * 453.59237,
+ MassFlowUnit.ShortTonPerHour => _value * 907.18474 / 3.6,
+ MassFlowUnit.TonnePerDay => _value / 0.0864000,
+ MassFlowUnit.TonnePerHour => _value * 1000 / 3.6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MassFlowUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MassFlowUnit.CentigramPerDay => (baseUnitValue * 86400) / 1e-2d,
+ MassFlowUnit.CentigramPerSecond => (baseUnitValue) / 1e-2d,
+ MassFlowUnit.DecagramPerDay => (baseUnitValue * 86400) / 1e1d,
+ MassFlowUnit.DecagramPerSecond => (baseUnitValue) / 1e1d,
+ MassFlowUnit.DecigramPerDay => (baseUnitValue * 86400) / 1e-1d,
+ MassFlowUnit.DecigramPerSecond => (baseUnitValue) / 1e-1d,
+ MassFlowUnit.GramPerDay => baseUnitValue * 86400,
+ MassFlowUnit.GramPerHour => baseUnitValue * 3600,
+ MassFlowUnit.GramPerSecond => baseUnitValue,
+ MassFlowUnit.HectogramPerDay => (baseUnitValue * 86400) / 1e2d,
+ MassFlowUnit.HectogramPerSecond => (baseUnitValue) / 1e2d,
+ MassFlowUnit.KilogramPerDay => (baseUnitValue * 86400) / 1e3d,
+ MassFlowUnit.KilogramPerHour => baseUnitValue * 3.6,
+ MassFlowUnit.KilogramPerMinute => baseUnitValue * 0.06,
+ MassFlowUnit.KilogramPerSecond => (baseUnitValue) / 1e3d,
+ MassFlowUnit.MegagramPerDay => (baseUnitValue * 86400) / 1e6d,
+ MassFlowUnit.MegapoundPerDay => (baseUnitValue * 86400 / 453.59237) / 1e6d,
+ MassFlowUnit.MegapoundPerHour => (baseUnitValue * 3600 / 453.59237) / 1e6d,
+ MassFlowUnit.MegapoundPerMinute => (baseUnitValue * 60 / 453.59237) / 1e6d,
+ MassFlowUnit.MegapoundPerSecond => (baseUnitValue / 453.59237) / 1e6d,
+ MassFlowUnit.MicrogramPerDay => (baseUnitValue * 86400) / 1e-6d,
+ MassFlowUnit.MicrogramPerSecond => (baseUnitValue) / 1e-6d,
+ MassFlowUnit.MilligramPerDay => (baseUnitValue * 86400) / 1e-3d,
+ MassFlowUnit.MilligramPerSecond => (baseUnitValue) / 1e-3d,
+ MassFlowUnit.NanogramPerDay => (baseUnitValue * 86400) / 1e-9d,
+ MassFlowUnit.NanogramPerSecond => (baseUnitValue) / 1e-9d,
+ MassFlowUnit.PoundPerDay => baseUnitValue * 86400 / 453.59237,
+ MassFlowUnit.PoundPerHour => baseUnitValue * 3600 / 453.59237,
+ MassFlowUnit.PoundPerMinute => baseUnitValue * 60 / 453.59237,
+ MassFlowUnit.PoundPerSecond => baseUnitValue / 453.59237,
+ MassFlowUnit.ShortTonPerHour => baseUnitValue * 3.6 / 907.18474,
+ MassFlowUnit.TonnePerDay => baseUnitValue * 0.0864000,
+ MassFlowUnit.TonnePerHour => baseUnitValue * 3.6 / 1000,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlux.g.cs
index 3d73e1427c..7da4fea75b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlux.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFlux.g.cs
@@ -215,75 +215,75 @@ public static MassFlux From(double value, MassFluxUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MassFluxUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MassFlux to another MassFlux with the unit representation .
- ///
- /// A MassFlux with the specified unit.
- public MassFlux ToUnit(MassFluxUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MassFlux(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MassFluxUnit.GramPerHourPerSquareCentimeter => _value / 3.6e2,
- MassFluxUnit.GramPerHourPerSquareMeter => _value / 3.6e6,
- MassFluxUnit.GramPerHourPerSquareMillimeter => _value / 3.6e0,
- MassFluxUnit.GramPerSecondPerSquareCentimeter => _value / 1e-1,
- MassFluxUnit.GramPerSecondPerSquareMeter => _value / 1e3,
- MassFluxUnit.GramPerSecondPerSquareMillimeter => _value / 1e-3,
- MassFluxUnit.KilogramPerHourPerSquareCentimeter => (_value / 3.6e2) * 1e3d,
- MassFluxUnit.KilogramPerHourPerSquareMeter => (_value / 3.6e6) * 1e3d,
- MassFluxUnit.KilogramPerHourPerSquareMillimeter => (_value / 3.6e0) * 1e3d,
- MassFluxUnit.KilogramPerSecondPerSquareCentimeter => (_value / 1e-1) * 1e3d,
- MassFluxUnit.KilogramPerSecondPerSquareMeter => (_value / 1e3) * 1e3d,
- MassFluxUnit.KilogramPerSecondPerSquareMillimeter => (_value / 1e-3) * 1e3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MassFluxUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MassFluxUnit.GramPerHourPerSquareCentimeter => baseUnitValue * 3.6e2,
- MassFluxUnit.GramPerHourPerSquareMeter => baseUnitValue * 3.6e6,
- MassFluxUnit.GramPerHourPerSquareMillimeter => baseUnitValue * 3.6e0,
- MassFluxUnit.GramPerSecondPerSquareCentimeter => baseUnitValue * 1e-1,
- MassFluxUnit.GramPerSecondPerSquareMeter => baseUnitValue * 1e3,
- MassFluxUnit.GramPerSecondPerSquareMillimeter => baseUnitValue * 1e-3,
- MassFluxUnit.KilogramPerHourPerSquareCentimeter => (baseUnitValue * 3.6e2) / 1e3d,
- MassFluxUnit.KilogramPerHourPerSquareMeter => (baseUnitValue * 3.6e6) / 1e3d,
- MassFluxUnit.KilogramPerHourPerSquareMillimeter => (baseUnitValue * 3.6e0) / 1e3d,
- MassFluxUnit.KilogramPerSecondPerSquareCentimeter => (baseUnitValue * 1e-1) / 1e3d,
- MassFluxUnit.KilogramPerSecondPerSquareMeter => (baseUnitValue * 1e3) / 1e3d,
- MassFluxUnit.KilogramPerSecondPerSquareMillimeter => (baseUnitValue * 1e-3) / 1e3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MassFluxUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MassFlux to another MassFlux with the unit representation .
+ ///
+ /// A MassFlux with the specified unit.
+ public MassFlux ToUnit(MassFluxUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MassFlux(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MassFluxUnit.GramPerHourPerSquareCentimeter => _value / 3.6e2,
+ MassFluxUnit.GramPerHourPerSquareMeter => _value / 3.6e6,
+ MassFluxUnit.GramPerHourPerSquareMillimeter => _value / 3.6e0,
+ MassFluxUnit.GramPerSecondPerSquareCentimeter => _value / 1e-1,
+ MassFluxUnit.GramPerSecondPerSquareMeter => _value / 1e3,
+ MassFluxUnit.GramPerSecondPerSquareMillimeter => _value / 1e-3,
+ MassFluxUnit.KilogramPerHourPerSquareCentimeter => (_value / 3.6e2) * 1e3d,
+ MassFluxUnit.KilogramPerHourPerSquareMeter => (_value / 3.6e6) * 1e3d,
+ MassFluxUnit.KilogramPerHourPerSquareMillimeter => (_value / 3.6e0) * 1e3d,
+ MassFluxUnit.KilogramPerSecondPerSquareCentimeter => (_value / 1e-1) * 1e3d,
+ MassFluxUnit.KilogramPerSecondPerSquareMeter => (_value / 1e3) * 1e3d,
+ MassFluxUnit.KilogramPerSecondPerSquareMillimeter => (_value / 1e-3) * 1e3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MassFluxUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MassFluxUnit.GramPerHourPerSquareCentimeter => baseUnitValue * 3.6e2,
+ MassFluxUnit.GramPerHourPerSquareMeter => baseUnitValue * 3.6e6,
+ MassFluxUnit.GramPerHourPerSquareMillimeter => baseUnitValue * 3.6e0,
+ MassFluxUnit.GramPerSecondPerSquareCentimeter => baseUnitValue * 1e-1,
+ MassFluxUnit.GramPerSecondPerSquareMeter => baseUnitValue * 1e3,
+ MassFluxUnit.GramPerSecondPerSquareMillimeter => baseUnitValue * 1e-3,
+ MassFluxUnit.KilogramPerHourPerSquareCentimeter => (baseUnitValue * 3.6e2) / 1e3d,
+ MassFluxUnit.KilogramPerHourPerSquareMeter => (baseUnitValue * 3.6e6) / 1e3d,
+ MassFluxUnit.KilogramPerHourPerSquareMillimeter => (baseUnitValue * 3.6e0) / 1e3d,
+ MassFluxUnit.KilogramPerSecondPerSquareCentimeter => (baseUnitValue * 1e-1) / 1e3d,
+ MassFluxUnit.KilogramPerSecondPerSquareMeter => (baseUnitValue * 1e3) / 1e3d,
+ MassFluxUnit.KilogramPerSecondPerSquareMillimeter => (baseUnitValue * 1e-3) / 1e3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFraction.g.cs
index bf63376d96..6ead0b711b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFraction.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassFraction.g.cs
@@ -338,99 +338,99 @@ public static MassFraction From(double value, MassFractionUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MassFractionUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MassFraction to another MassFraction with the unit representation .
- ///
- /// A MassFraction with the specified unit.
- public MassFraction ToUnit(MassFractionUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MassFraction(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MassFractionUnit.CentigramPerGram => (_value) * 1e-2d,
- MassFractionUnit.CentigramPerKilogram => (_value / 1e3) * 1e-2d,
- MassFractionUnit.DecagramPerGram => (_value) * 1e1d,
- MassFractionUnit.DecagramPerKilogram => (_value / 1e3) * 1e1d,
- MassFractionUnit.DecigramPerGram => (_value) * 1e-1d,
- MassFractionUnit.DecigramPerKilogram => (_value / 1e3) * 1e-1d,
- MassFractionUnit.DecimalFraction => _value,
- MassFractionUnit.GramPerGram => _value,
- MassFractionUnit.GramPerKilogram => _value / 1e3,
- MassFractionUnit.HectogramPerGram => (_value) * 1e2d,
- MassFractionUnit.HectogramPerKilogram => (_value / 1e3) * 1e2d,
- MassFractionUnit.KilogramPerGram => (_value) * 1e3d,
- MassFractionUnit.KilogramPerKilogram => (_value / 1e3) * 1e3d,
- MassFractionUnit.MicrogramPerGram => (_value) * 1e-6d,
- MassFractionUnit.MicrogramPerKilogram => (_value / 1e3) * 1e-6d,
- MassFractionUnit.MilligramPerGram => (_value) * 1e-3d,
- MassFractionUnit.MilligramPerKilogram => (_value / 1e3) * 1e-3d,
- MassFractionUnit.NanogramPerGram => (_value) * 1e-9d,
- MassFractionUnit.NanogramPerKilogram => (_value / 1e3) * 1e-9d,
- MassFractionUnit.PartPerBillion => _value / 1e9,
- MassFractionUnit.PartPerMillion => _value / 1e6,
- MassFractionUnit.PartPerThousand => _value / 1e3,
- MassFractionUnit.PartPerTrillion => _value / 1e12,
- MassFractionUnit.Percent => _value / 1e2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MassFractionUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MassFractionUnit.CentigramPerGram => (baseUnitValue) / 1e-2d,
- MassFractionUnit.CentigramPerKilogram => (baseUnitValue * 1e3) / 1e-2d,
- MassFractionUnit.DecagramPerGram => (baseUnitValue) / 1e1d,
- MassFractionUnit.DecagramPerKilogram => (baseUnitValue * 1e3) / 1e1d,
- MassFractionUnit.DecigramPerGram => (baseUnitValue) / 1e-1d,
- MassFractionUnit.DecigramPerKilogram => (baseUnitValue * 1e3) / 1e-1d,
- MassFractionUnit.DecimalFraction => baseUnitValue,
- MassFractionUnit.GramPerGram => baseUnitValue,
- MassFractionUnit.GramPerKilogram => baseUnitValue * 1e3,
- MassFractionUnit.HectogramPerGram => (baseUnitValue) / 1e2d,
- MassFractionUnit.HectogramPerKilogram => (baseUnitValue * 1e3) / 1e2d,
- MassFractionUnit.KilogramPerGram => (baseUnitValue) / 1e3d,
- MassFractionUnit.KilogramPerKilogram => (baseUnitValue * 1e3) / 1e3d,
- MassFractionUnit.MicrogramPerGram => (baseUnitValue) / 1e-6d,
- MassFractionUnit.MicrogramPerKilogram => (baseUnitValue * 1e3) / 1e-6d,
- MassFractionUnit.MilligramPerGram => (baseUnitValue) / 1e-3d,
- MassFractionUnit.MilligramPerKilogram => (baseUnitValue * 1e3) / 1e-3d,
- MassFractionUnit.NanogramPerGram => (baseUnitValue) / 1e-9d,
- MassFractionUnit.NanogramPerKilogram => (baseUnitValue * 1e3) / 1e-9d,
- MassFractionUnit.PartPerBillion => baseUnitValue * 1e9,
- MassFractionUnit.PartPerMillion => baseUnitValue * 1e6,
- MassFractionUnit.PartPerThousand => baseUnitValue * 1e3,
- MassFractionUnit.PartPerTrillion => baseUnitValue * 1e12,
- MassFractionUnit.Percent => baseUnitValue * 1e2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MassFractionUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MassFraction to another MassFraction with the unit representation .
+ ///
+ /// A MassFraction with the specified unit.
+ public MassFraction ToUnit(MassFractionUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MassFraction(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MassFractionUnit.CentigramPerGram => (_value) * 1e-2d,
+ MassFractionUnit.CentigramPerKilogram => (_value / 1e3) * 1e-2d,
+ MassFractionUnit.DecagramPerGram => (_value) * 1e1d,
+ MassFractionUnit.DecagramPerKilogram => (_value / 1e3) * 1e1d,
+ MassFractionUnit.DecigramPerGram => (_value) * 1e-1d,
+ MassFractionUnit.DecigramPerKilogram => (_value / 1e3) * 1e-1d,
+ MassFractionUnit.DecimalFraction => _value,
+ MassFractionUnit.GramPerGram => _value,
+ MassFractionUnit.GramPerKilogram => _value / 1e3,
+ MassFractionUnit.HectogramPerGram => (_value) * 1e2d,
+ MassFractionUnit.HectogramPerKilogram => (_value / 1e3) * 1e2d,
+ MassFractionUnit.KilogramPerGram => (_value) * 1e3d,
+ MassFractionUnit.KilogramPerKilogram => (_value / 1e3) * 1e3d,
+ MassFractionUnit.MicrogramPerGram => (_value) * 1e-6d,
+ MassFractionUnit.MicrogramPerKilogram => (_value / 1e3) * 1e-6d,
+ MassFractionUnit.MilligramPerGram => (_value) * 1e-3d,
+ MassFractionUnit.MilligramPerKilogram => (_value / 1e3) * 1e-3d,
+ MassFractionUnit.NanogramPerGram => (_value) * 1e-9d,
+ MassFractionUnit.NanogramPerKilogram => (_value / 1e3) * 1e-9d,
+ MassFractionUnit.PartPerBillion => _value / 1e9,
+ MassFractionUnit.PartPerMillion => _value / 1e6,
+ MassFractionUnit.PartPerThousand => _value / 1e3,
+ MassFractionUnit.PartPerTrillion => _value / 1e12,
+ MassFractionUnit.Percent => _value / 1e2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MassFractionUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MassFractionUnit.CentigramPerGram => (baseUnitValue) / 1e-2d,
+ MassFractionUnit.CentigramPerKilogram => (baseUnitValue * 1e3) / 1e-2d,
+ MassFractionUnit.DecagramPerGram => (baseUnitValue) / 1e1d,
+ MassFractionUnit.DecagramPerKilogram => (baseUnitValue * 1e3) / 1e1d,
+ MassFractionUnit.DecigramPerGram => (baseUnitValue) / 1e-1d,
+ MassFractionUnit.DecigramPerKilogram => (baseUnitValue * 1e3) / 1e-1d,
+ MassFractionUnit.DecimalFraction => baseUnitValue,
+ MassFractionUnit.GramPerGram => baseUnitValue,
+ MassFractionUnit.GramPerKilogram => baseUnitValue * 1e3,
+ MassFractionUnit.HectogramPerGram => (baseUnitValue) / 1e2d,
+ MassFractionUnit.HectogramPerKilogram => (baseUnitValue * 1e3) / 1e2d,
+ MassFractionUnit.KilogramPerGram => (baseUnitValue) / 1e3d,
+ MassFractionUnit.KilogramPerKilogram => (baseUnitValue * 1e3) / 1e3d,
+ MassFractionUnit.MicrogramPerGram => (baseUnitValue) / 1e-6d,
+ MassFractionUnit.MicrogramPerKilogram => (baseUnitValue * 1e3) / 1e-6d,
+ MassFractionUnit.MilligramPerGram => (baseUnitValue) / 1e-3d,
+ MassFractionUnit.MilligramPerKilogram => (baseUnitValue * 1e3) / 1e-3d,
+ MassFractionUnit.NanogramPerGram => (baseUnitValue) / 1e-9d,
+ MassFractionUnit.NanogramPerKilogram => (baseUnitValue * 1e3) / 1e-9d,
+ MassFractionUnit.PartPerBillion => baseUnitValue * 1e9,
+ MassFractionUnit.PartPerMillion => baseUnitValue * 1e6,
+ MassFractionUnit.PartPerThousand => baseUnitValue * 1e3,
+ MassFractionUnit.PartPerTrillion => baseUnitValue * 1e12,
+ MassFractionUnit.Percent => baseUnitValue * 1e2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassMomentOfInertia.g.cs
index 1c80b42c24..51b36064af 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassMomentOfInertia.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MassMomentOfInertia.g.cs
@@ -375,107 +375,107 @@ public static MassMomentOfInertia From(double value, MassMomentOfInertiaUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MassMomentOfInertiaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MassMomentOfInertia to another MassMomentOfInertia with the unit representation .
- ///
- /// A MassMomentOfInertia with the specified unit.
- public MassMomentOfInertia ToUnit(MassMomentOfInertiaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MassMomentOfInertia(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MassMomentOfInertiaUnit.GramSquareCentimeter => _value / 1e7,
- MassMomentOfInertiaUnit.GramSquareDecimeter => _value / 1e5,
- MassMomentOfInertiaUnit.GramSquareMeter => _value / 1e3,
- MassMomentOfInertiaUnit.GramSquareMillimeter => _value / 1e9,
- MassMomentOfInertiaUnit.KilogramSquareCentimeter => (_value / 1e7) * 1e3d,
- MassMomentOfInertiaUnit.KilogramSquareDecimeter => (_value / 1e5) * 1e3d,
- MassMomentOfInertiaUnit.KilogramSquareMeter => (_value / 1e3) * 1e3d,
- MassMomentOfInertiaUnit.KilogramSquareMillimeter => (_value / 1e9) * 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareCentimeter => (_value / 1e1) * 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareDecimeter => (_value / 1e-1) * 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareMeter => (_value / 1e-3) * 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareMillimeter => (_value / 1e3) * 1e3d,
- MassMomentOfInertiaUnit.MegatonneSquareCentimeter => (_value / 1e1) * 1e6d,
- MassMomentOfInertiaUnit.MegatonneSquareDecimeter => (_value / 1e-1) * 1e6d,
- MassMomentOfInertiaUnit.MegatonneSquareMeter => (_value / 1e-3) * 1e6d,
- MassMomentOfInertiaUnit.MegatonneSquareMillimeter => (_value / 1e3) * 1e6d,
- MassMomentOfInertiaUnit.MilligramSquareCentimeter => (_value / 1e7) * 1e-3d,
- MassMomentOfInertiaUnit.MilligramSquareDecimeter => (_value / 1e5) * 1e-3d,
- MassMomentOfInertiaUnit.MilligramSquareMeter => (_value / 1e3) * 1e-3d,
- MassMomentOfInertiaUnit.MilligramSquareMillimeter => (_value / 1e9) * 1e-3d,
- MassMomentOfInertiaUnit.PoundSquareFoot => _value * (0.45359237 * 9.290304e-2),
- MassMomentOfInertiaUnit.PoundSquareInch => _value * (0.45359237 * 0.00064516),
- MassMomentOfInertiaUnit.SlugSquareFoot => _value * 0.45359237 * 9.290304e-2 * 9.80665 / 0.3048,
- MassMomentOfInertiaUnit.SlugSquareInch => _value * 0.45359237 * 0.00064516 * 9.80665 / 0.3048,
- MassMomentOfInertiaUnit.TonneSquareCentimeter => _value / 1e1,
- MassMomentOfInertiaUnit.TonneSquareDecimeter => _value / 1e-1,
- MassMomentOfInertiaUnit.TonneSquareMeter => _value / 1e-3,
- MassMomentOfInertiaUnit.TonneSquareMillimeter => _value / 1e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MassMomentOfInertiaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MassMomentOfInertiaUnit.GramSquareCentimeter => baseUnitValue * 1e7,
- MassMomentOfInertiaUnit.GramSquareDecimeter => baseUnitValue * 1e5,
- MassMomentOfInertiaUnit.GramSquareMeter => baseUnitValue * 1e3,
- MassMomentOfInertiaUnit.GramSquareMillimeter => baseUnitValue * 1e9,
- MassMomentOfInertiaUnit.KilogramSquareCentimeter => (baseUnitValue * 1e7) / 1e3d,
- MassMomentOfInertiaUnit.KilogramSquareDecimeter => (baseUnitValue * 1e5) / 1e3d,
- MassMomentOfInertiaUnit.KilogramSquareMeter => (baseUnitValue * 1e3) / 1e3d,
- MassMomentOfInertiaUnit.KilogramSquareMillimeter => (baseUnitValue * 1e9) / 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareCentimeter => (baseUnitValue * 1e1) / 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareDecimeter => (baseUnitValue * 1e-1) / 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareMeter => (baseUnitValue * 1e-3) / 1e3d,
- MassMomentOfInertiaUnit.KilotonneSquareMillimeter => (baseUnitValue * 1e3) / 1e3d,
- MassMomentOfInertiaUnit.MegatonneSquareCentimeter => (baseUnitValue * 1e1) / 1e6d,
- MassMomentOfInertiaUnit.MegatonneSquareDecimeter => (baseUnitValue * 1e-1) / 1e6d,
- MassMomentOfInertiaUnit.MegatonneSquareMeter => (baseUnitValue * 1e-3) / 1e6d,
- MassMomentOfInertiaUnit.MegatonneSquareMillimeter => (baseUnitValue * 1e3) / 1e6d,
- MassMomentOfInertiaUnit.MilligramSquareCentimeter => (baseUnitValue * 1e7) / 1e-3d,
- MassMomentOfInertiaUnit.MilligramSquareDecimeter => (baseUnitValue * 1e5) / 1e-3d,
- MassMomentOfInertiaUnit.MilligramSquareMeter => (baseUnitValue * 1e3) / 1e-3d,
- MassMomentOfInertiaUnit.MilligramSquareMillimeter => (baseUnitValue * 1e9) / 1e-3d,
- MassMomentOfInertiaUnit.PoundSquareFoot => baseUnitValue / (0.45359237 * 9.290304e-2),
- MassMomentOfInertiaUnit.PoundSquareInch => baseUnitValue / (0.45359237 * 0.00064516),
- MassMomentOfInertiaUnit.SlugSquareFoot => baseUnitValue * 0.3048 / (0.45359237 * 9.290304e-2 * 9.80665),
- MassMomentOfInertiaUnit.SlugSquareInch => baseUnitValue * 0.3048 / (0.45359237 * 0.00064516 * 9.80665),
- MassMomentOfInertiaUnit.TonneSquareCentimeter => baseUnitValue * 1e1,
- MassMomentOfInertiaUnit.TonneSquareDecimeter => baseUnitValue * 1e-1,
- MassMomentOfInertiaUnit.TonneSquareMeter => baseUnitValue * 1e-3,
- MassMomentOfInertiaUnit.TonneSquareMillimeter => baseUnitValue * 1e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MassMomentOfInertiaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MassMomentOfInertia to another MassMomentOfInertia with the unit representation .
+ ///
+ /// A MassMomentOfInertia with the specified unit.
+ public MassMomentOfInertia ToUnit(MassMomentOfInertiaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MassMomentOfInertia(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MassMomentOfInertiaUnit.GramSquareCentimeter => _value / 1e7,
+ MassMomentOfInertiaUnit.GramSquareDecimeter => _value / 1e5,
+ MassMomentOfInertiaUnit.GramSquareMeter => _value / 1e3,
+ MassMomentOfInertiaUnit.GramSquareMillimeter => _value / 1e9,
+ MassMomentOfInertiaUnit.KilogramSquareCentimeter => (_value / 1e7) * 1e3d,
+ MassMomentOfInertiaUnit.KilogramSquareDecimeter => (_value / 1e5) * 1e3d,
+ MassMomentOfInertiaUnit.KilogramSquareMeter => (_value / 1e3) * 1e3d,
+ MassMomentOfInertiaUnit.KilogramSquareMillimeter => (_value / 1e9) * 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareCentimeter => (_value / 1e1) * 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareDecimeter => (_value / 1e-1) * 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareMeter => (_value / 1e-3) * 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareMillimeter => (_value / 1e3) * 1e3d,
+ MassMomentOfInertiaUnit.MegatonneSquareCentimeter => (_value / 1e1) * 1e6d,
+ MassMomentOfInertiaUnit.MegatonneSquareDecimeter => (_value / 1e-1) * 1e6d,
+ MassMomentOfInertiaUnit.MegatonneSquareMeter => (_value / 1e-3) * 1e6d,
+ MassMomentOfInertiaUnit.MegatonneSquareMillimeter => (_value / 1e3) * 1e6d,
+ MassMomentOfInertiaUnit.MilligramSquareCentimeter => (_value / 1e7) * 1e-3d,
+ MassMomentOfInertiaUnit.MilligramSquareDecimeter => (_value / 1e5) * 1e-3d,
+ MassMomentOfInertiaUnit.MilligramSquareMeter => (_value / 1e3) * 1e-3d,
+ MassMomentOfInertiaUnit.MilligramSquareMillimeter => (_value / 1e9) * 1e-3d,
+ MassMomentOfInertiaUnit.PoundSquareFoot => _value * (0.45359237 * 9.290304e-2),
+ MassMomentOfInertiaUnit.PoundSquareInch => _value * (0.45359237 * 0.00064516),
+ MassMomentOfInertiaUnit.SlugSquareFoot => _value * 0.45359237 * 9.290304e-2 * 9.80665 / 0.3048,
+ MassMomentOfInertiaUnit.SlugSquareInch => _value * 0.45359237 * 0.00064516 * 9.80665 / 0.3048,
+ MassMomentOfInertiaUnit.TonneSquareCentimeter => _value / 1e1,
+ MassMomentOfInertiaUnit.TonneSquareDecimeter => _value / 1e-1,
+ MassMomentOfInertiaUnit.TonneSquareMeter => _value / 1e-3,
+ MassMomentOfInertiaUnit.TonneSquareMillimeter => _value / 1e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MassMomentOfInertiaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MassMomentOfInertiaUnit.GramSquareCentimeter => baseUnitValue * 1e7,
+ MassMomentOfInertiaUnit.GramSquareDecimeter => baseUnitValue * 1e5,
+ MassMomentOfInertiaUnit.GramSquareMeter => baseUnitValue * 1e3,
+ MassMomentOfInertiaUnit.GramSquareMillimeter => baseUnitValue * 1e9,
+ MassMomentOfInertiaUnit.KilogramSquareCentimeter => (baseUnitValue * 1e7) / 1e3d,
+ MassMomentOfInertiaUnit.KilogramSquareDecimeter => (baseUnitValue * 1e5) / 1e3d,
+ MassMomentOfInertiaUnit.KilogramSquareMeter => (baseUnitValue * 1e3) / 1e3d,
+ MassMomentOfInertiaUnit.KilogramSquareMillimeter => (baseUnitValue * 1e9) / 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareCentimeter => (baseUnitValue * 1e1) / 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareDecimeter => (baseUnitValue * 1e-1) / 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareMeter => (baseUnitValue * 1e-3) / 1e3d,
+ MassMomentOfInertiaUnit.KilotonneSquareMillimeter => (baseUnitValue * 1e3) / 1e3d,
+ MassMomentOfInertiaUnit.MegatonneSquareCentimeter => (baseUnitValue * 1e1) / 1e6d,
+ MassMomentOfInertiaUnit.MegatonneSquareDecimeter => (baseUnitValue * 1e-1) / 1e6d,
+ MassMomentOfInertiaUnit.MegatonneSquareMeter => (baseUnitValue * 1e-3) / 1e6d,
+ MassMomentOfInertiaUnit.MegatonneSquareMillimeter => (baseUnitValue * 1e3) / 1e6d,
+ MassMomentOfInertiaUnit.MilligramSquareCentimeter => (baseUnitValue * 1e7) / 1e-3d,
+ MassMomentOfInertiaUnit.MilligramSquareDecimeter => (baseUnitValue * 1e5) / 1e-3d,
+ MassMomentOfInertiaUnit.MilligramSquareMeter => (baseUnitValue * 1e3) / 1e-3d,
+ MassMomentOfInertiaUnit.MilligramSquareMillimeter => (baseUnitValue * 1e9) / 1e-3d,
+ MassMomentOfInertiaUnit.PoundSquareFoot => baseUnitValue / (0.45359237 * 9.290304e-2),
+ MassMomentOfInertiaUnit.PoundSquareInch => baseUnitValue / (0.45359237 * 0.00064516),
+ MassMomentOfInertiaUnit.SlugSquareFoot => baseUnitValue * 0.3048 / (0.45359237 * 9.290304e-2 * 9.80665),
+ MassMomentOfInertiaUnit.SlugSquareInch => baseUnitValue * 0.3048 / (0.45359237 * 0.00064516 * 9.80665),
+ MassMomentOfInertiaUnit.TonneSquareCentimeter => baseUnitValue * 1e1,
+ MassMomentOfInertiaUnit.TonneSquareDecimeter => baseUnitValue * 1e-1,
+ MassMomentOfInertiaUnit.TonneSquareMeter => baseUnitValue * 1e-3,
+ MassMomentOfInertiaUnit.TonneSquareMillimeter => baseUnitValue * 1e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molality.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molality.g.cs
index d959f00afc..cfe8136078 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molality.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molality.g.cs
@@ -128,57 +128,57 @@ public static Molality From(double value, MolalityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MolalityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Molality to another Molality with the unit representation .
- ///
- /// A Molality with the specified unit.
- public Molality ToUnit(MolalityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Molality(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MolalityUnit.MillimolePerKilogram => (_value) * 1e-3d,
- MolalityUnit.MolePerGram => _value / 1e-3,
- MolalityUnit.MolePerKilogram => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MolalityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MolalityUnit.MillimolePerKilogram => (baseUnitValue) / 1e-3d,
- MolalityUnit.MolePerGram => baseUnitValue * 1e-3,
- MolalityUnit.MolePerKilogram => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MolalityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Molality to another Molality with the unit representation .
+ ///
+ /// A Molality with the specified unit.
+ public Molality ToUnit(MolalityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Molality(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MolalityUnit.MillimolePerKilogram => (_value) * 1e-3d,
+ MolalityUnit.MolePerGram => _value / 1e-3,
+ MolalityUnit.MolePerKilogram => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MolalityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MolalityUnit.MillimolePerKilogram => (baseUnitValue) / 1e-3d,
+ MolalityUnit.MolePerGram => baseUnitValue * 1e-3,
+ MolalityUnit.MolePerKilogram => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEnergy.g.cs
index 2934e13f88..bb821713a2 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEnergy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEnergy.g.cs
@@ -125,57 +125,57 @@ public static MolarEnergy From(double value, MolarEnergyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MolarEnergyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MolarEnergy to another MolarEnergy with the unit representation .
- ///
- /// A MolarEnergy with the specified unit.
- public MolarEnergy ToUnit(MolarEnergyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MolarEnergy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MolarEnergyUnit.JoulePerMole => _value,
- MolarEnergyUnit.KilojoulePerMole => (_value) * 1e3d,
- MolarEnergyUnit.MegajoulePerMole => (_value) * 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MolarEnergyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MolarEnergyUnit.JoulePerMole => baseUnitValue,
- MolarEnergyUnit.KilojoulePerMole => (baseUnitValue) / 1e3d,
- MolarEnergyUnit.MegajoulePerMole => (baseUnitValue) / 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MolarEnergyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MolarEnergy to another MolarEnergy with the unit representation .
+ ///
+ /// A MolarEnergy with the specified unit.
+ public MolarEnergy ToUnit(MolarEnergyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MolarEnergy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MolarEnergyUnit.JoulePerMole => _value,
+ MolarEnergyUnit.KilojoulePerMole => (_value) * 1e3d,
+ MolarEnergyUnit.MegajoulePerMole => (_value) * 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MolarEnergyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MolarEnergyUnit.JoulePerMole => baseUnitValue,
+ MolarEnergyUnit.KilojoulePerMole => (baseUnitValue) / 1e3d,
+ MolarEnergyUnit.MegajoulePerMole => (baseUnitValue) / 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEntropy.g.cs
index caedf9eaba..10758f8400 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEntropy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarEntropy.g.cs
@@ -125,57 +125,57 @@ public static MolarEntropy From(double value, MolarEntropyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MolarEntropyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MolarEntropy to another MolarEntropy with the unit representation .
- ///
- /// A MolarEntropy with the specified unit.
- public MolarEntropy ToUnit(MolarEntropyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MolarEntropy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MolarEntropyUnit.JoulePerMoleKelvin => _value,
- MolarEntropyUnit.KilojoulePerMoleKelvin => (_value) * 1e3d,
- MolarEntropyUnit.MegajoulePerMoleKelvin => (_value) * 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MolarEntropyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MolarEntropyUnit.JoulePerMoleKelvin => baseUnitValue,
- MolarEntropyUnit.KilojoulePerMoleKelvin => (baseUnitValue) / 1e3d,
- MolarEntropyUnit.MegajoulePerMoleKelvin => (baseUnitValue) / 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MolarEntropyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MolarEntropy to another MolarEntropy with the unit representation .
+ ///
+ /// A MolarEntropy with the specified unit.
+ public MolarEntropy ToUnit(MolarEntropyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MolarEntropy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MolarEntropyUnit.JoulePerMoleKelvin => _value,
+ MolarEntropyUnit.KilojoulePerMoleKelvin => (_value) * 1e3d,
+ MolarEntropyUnit.MegajoulePerMoleKelvin => (_value) * 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MolarEntropyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MolarEntropyUnit.JoulePerMoleKelvin => baseUnitValue,
+ MolarEntropyUnit.KilojoulePerMoleKelvin => (baseUnitValue) / 1e3d,
+ MolarEntropyUnit.MegajoulePerMoleKelvin => (baseUnitValue) / 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarFlow.g.cs
index 3aca64c697..1312357fe1 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarFlow.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarFlow.g.cs
@@ -185,69 +185,69 @@ public static MolarFlow From(double value, MolarFlowUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MolarFlowUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MolarFlow to another MolarFlow with the unit representation .
- ///
- /// A MolarFlow with the specified unit.
- public MolarFlow ToUnit(MolarFlowUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MolarFlow(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MolarFlowUnit.KilomolePerHour => (_value / 3600) * 1e3d,
- MolarFlowUnit.KilomolePerMinute => (_value / 60) * 1e3d,
- MolarFlowUnit.KilomolePerSecond => (_value) * 1e3d,
- MolarFlowUnit.MolePerHour => _value / 3600,
- MolarFlowUnit.MolePerMinute => _value / 60,
- MolarFlowUnit.MolePerSecond => _value,
- MolarFlowUnit.PoundMolePerHour => (_value * 453.59237) / 3600,
- MolarFlowUnit.PoundMolePerMinute => (_value * 453.59237) / 60,
- MolarFlowUnit.PoundMolePerSecond => _value * 453.59237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MolarFlowUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MolarFlowUnit.KilomolePerHour => (baseUnitValue * 3600) / 1e3d,
- MolarFlowUnit.KilomolePerMinute => (baseUnitValue * 60) / 1e3d,
- MolarFlowUnit.KilomolePerSecond => (baseUnitValue) / 1e3d,
- MolarFlowUnit.MolePerHour => baseUnitValue * 3600,
- MolarFlowUnit.MolePerMinute => baseUnitValue * 60,
- MolarFlowUnit.MolePerSecond => baseUnitValue,
- MolarFlowUnit.PoundMolePerHour => (baseUnitValue / 453.59237) * 3600,
- MolarFlowUnit.PoundMolePerMinute => (baseUnitValue / 453.59237) * 60,
- MolarFlowUnit.PoundMolePerSecond => baseUnitValue / 453.59237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MolarFlowUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MolarFlow to another MolarFlow with the unit representation .
+ ///
+ /// A MolarFlow with the specified unit.
+ public MolarFlow ToUnit(MolarFlowUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MolarFlow(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MolarFlowUnit.KilomolePerHour => (_value / 3600) * 1e3d,
+ MolarFlowUnit.KilomolePerMinute => (_value / 60) * 1e3d,
+ MolarFlowUnit.KilomolePerSecond => (_value) * 1e3d,
+ MolarFlowUnit.MolePerHour => _value / 3600,
+ MolarFlowUnit.MolePerMinute => _value / 60,
+ MolarFlowUnit.MolePerSecond => _value,
+ MolarFlowUnit.PoundMolePerHour => (_value * 453.59237) / 3600,
+ MolarFlowUnit.PoundMolePerMinute => (_value * 453.59237) / 60,
+ MolarFlowUnit.PoundMolePerSecond => _value * 453.59237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MolarFlowUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MolarFlowUnit.KilomolePerHour => (baseUnitValue * 3600) / 1e3d,
+ MolarFlowUnit.KilomolePerMinute => (baseUnitValue * 60) / 1e3d,
+ MolarFlowUnit.KilomolePerSecond => (baseUnitValue) / 1e3d,
+ MolarFlowUnit.MolePerHour => baseUnitValue * 3600,
+ MolarFlowUnit.MolePerMinute => baseUnitValue * 60,
+ MolarFlowUnit.MolePerSecond => baseUnitValue,
+ MolarFlowUnit.PoundMolePerHour => (baseUnitValue / 453.59237) * 3600,
+ MolarFlowUnit.PoundMolePerMinute => (baseUnitValue / 453.59237) * 60,
+ MolarFlowUnit.PoundMolePerSecond => baseUnitValue / 453.59237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarMass.g.cs
index a61a13b27b..023268b7c1 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarMass.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/MolarMass.g.cs
@@ -225,77 +225,77 @@ public static MolarMass From(double value, MolarMassUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MolarMassUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this MolarMass to another MolarMass with the unit representation .
- ///
- /// A MolarMass with the specified unit.
- public MolarMass ToUnit(MolarMassUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new MolarMass(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MolarMassUnit.CentigramPerMole => (_value / 1e3) * 1e-2d,
- MolarMassUnit.DecagramPerMole => (_value / 1e3) * 1e1d,
- MolarMassUnit.DecigramPerMole => (_value / 1e3) * 1e-1d,
- MolarMassUnit.GramPerMole => _value / 1e3,
- MolarMassUnit.HectogramPerMole => (_value / 1e3) * 1e2d,
- MolarMassUnit.KilogramPerKilomole => _value / 1e3,
- MolarMassUnit.KilogramPerMole => (_value / 1e3) * 1e3d,
- MolarMassUnit.KilopoundPerMole => (_value * 0.45359237) * 1e3d,
- MolarMassUnit.MegapoundPerMole => (_value * 0.45359237) * 1e6d,
- MolarMassUnit.MicrogramPerMole => (_value / 1e3) * 1e-6d,
- MolarMassUnit.MilligramPerMole => (_value / 1e3) * 1e-3d,
- MolarMassUnit.NanogramPerMole => (_value / 1e3) * 1e-9d,
- MolarMassUnit.PoundPerMole => _value * 0.45359237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MolarMassUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MolarMassUnit.CentigramPerMole => (baseUnitValue * 1e3) / 1e-2d,
- MolarMassUnit.DecagramPerMole => (baseUnitValue * 1e3) / 1e1d,
- MolarMassUnit.DecigramPerMole => (baseUnitValue * 1e3) / 1e-1d,
- MolarMassUnit.GramPerMole => baseUnitValue * 1e3,
- MolarMassUnit.HectogramPerMole => (baseUnitValue * 1e3) / 1e2d,
- MolarMassUnit.KilogramPerKilomole => baseUnitValue * 1e3,
- MolarMassUnit.KilogramPerMole => (baseUnitValue * 1e3) / 1e3d,
- MolarMassUnit.KilopoundPerMole => (baseUnitValue / 0.45359237) / 1e3d,
- MolarMassUnit.MegapoundPerMole => (baseUnitValue / 0.45359237) / 1e6d,
- MolarMassUnit.MicrogramPerMole => (baseUnitValue * 1e3) / 1e-6d,
- MolarMassUnit.MilligramPerMole => (baseUnitValue * 1e3) / 1e-3d,
- MolarMassUnit.NanogramPerMole => (baseUnitValue * 1e3) / 1e-9d,
- MolarMassUnit.PoundPerMole => baseUnitValue / 0.45359237,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MolarMassUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this MolarMass to another MolarMass with the unit representation .
+ ///
+ /// A MolarMass with the specified unit.
+ public MolarMass ToUnit(MolarMassUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new MolarMass(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MolarMassUnit.CentigramPerMole => (_value / 1e3) * 1e-2d,
+ MolarMassUnit.DecagramPerMole => (_value / 1e3) * 1e1d,
+ MolarMassUnit.DecigramPerMole => (_value / 1e3) * 1e-1d,
+ MolarMassUnit.GramPerMole => _value / 1e3,
+ MolarMassUnit.HectogramPerMole => (_value / 1e3) * 1e2d,
+ MolarMassUnit.KilogramPerKilomole => _value / 1e3,
+ MolarMassUnit.KilogramPerMole => (_value / 1e3) * 1e3d,
+ MolarMassUnit.KilopoundPerMole => (_value * 0.45359237) * 1e3d,
+ MolarMassUnit.MegapoundPerMole => (_value * 0.45359237) * 1e6d,
+ MolarMassUnit.MicrogramPerMole => (_value / 1e3) * 1e-6d,
+ MolarMassUnit.MilligramPerMole => (_value / 1e3) * 1e-3d,
+ MolarMassUnit.NanogramPerMole => (_value / 1e3) * 1e-9d,
+ MolarMassUnit.PoundPerMole => _value * 0.45359237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MolarMassUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MolarMassUnit.CentigramPerMole => (baseUnitValue * 1e3) / 1e-2d,
+ MolarMassUnit.DecagramPerMole => (baseUnitValue * 1e3) / 1e1d,
+ MolarMassUnit.DecigramPerMole => (baseUnitValue * 1e3) / 1e-1d,
+ MolarMassUnit.GramPerMole => baseUnitValue * 1e3,
+ MolarMassUnit.HectogramPerMole => (baseUnitValue * 1e3) / 1e2d,
+ MolarMassUnit.KilogramPerKilomole => baseUnitValue * 1e3,
+ MolarMassUnit.KilogramPerMole => (baseUnitValue * 1e3) / 1e3d,
+ MolarMassUnit.KilopoundPerMole => (baseUnitValue / 0.45359237) / 1e3d,
+ MolarMassUnit.MegapoundPerMole => (baseUnitValue / 0.45359237) / 1e6d,
+ MolarMassUnit.MicrogramPerMole => (baseUnitValue * 1e3) / 1e-6d,
+ MolarMassUnit.MilligramPerMole => (baseUnitValue * 1e3) / 1e-3d,
+ MolarMassUnit.NanogramPerMole => (baseUnitValue * 1e3) / 1e-9d,
+ MolarMassUnit.PoundPerMole => baseUnitValue / 0.45359237,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molarity.g.cs
index 75a20a08f7..d45b03bf89 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molarity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Molarity.g.cs
@@ -208,73 +208,73 @@ public static Molarity From(double value, MolarityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(MolarityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Molarity to another Molarity with the unit representation .
- ///
- /// A Molarity with the specified unit.
- public Molarity ToUnit(MolarityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Molarity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- MolarityUnit.CentimolePerLiter => (_value / 1e-3) * 1e-2d,
- MolarityUnit.DecimolePerLiter => (_value / 1e-3) * 1e-1d,
- MolarityUnit.FemtomolePerLiter => (_value / 1e-3) * 1e-15d,
- MolarityUnit.KilomolePerCubicMeter => (_value) * 1e3d,
- MolarityUnit.MicromolePerLiter => (_value / 1e-3) * 1e-6d,
- MolarityUnit.MillimolePerLiter => (_value / 1e-3) * 1e-3d,
- MolarityUnit.MolePerCubicMeter => _value,
- MolarityUnit.MolePerLiter => _value / 1e-3,
- MolarityUnit.NanomolePerLiter => (_value / 1e-3) * 1e-9d,
- MolarityUnit.PicomolePerLiter => (_value / 1e-3) * 1e-12d,
- MolarityUnit.PoundMolePerCubicFoot => _value * 1000 * 0.45359237 / 0.028316846592,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(MolarityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- MolarityUnit.CentimolePerLiter => (baseUnitValue * 1e-3) / 1e-2d,
- MolarityUnit.DecimolePerLiter => (baseUnitValue * 1e-3) / 1e-1d,
- MolarityUnit.FemtomolePerLiter => (baseUnitValue * 1e-3) / 1e-15d,
- MolarityUnit.KilomolePerCubicMeter => (baseUnitValue) / 1e3d,
- MolarityUnit.MicromolePerLiter => (baseUnitValue * 1e-3) / 1e-6d,
- MolarityUnit.MillimolePerLiter => (baseUnitValue * 1e-3) / 1e-3d,
- MolarityUnit.MolePerCubicMeter => baseUnitValue,
- MolarityUnit.MolePerLiter => baseUnitValue * 1e-3,
- MolarityUnit.NanomolePerLiter => (baseUnitValue * 1e-3) / 1e-9d,
- MolarityUnit.PicomolePerLiter => (baseUnitValue * 1e-3) / 1e-12d,
- MolarityUnit.PoundMolePerCubicFoot => baseUnitValue / (1000 * 0.45359237 / 0.028316846592),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(MolarityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Molarity to another Molarity with the unit representation .
+ ///
+ /// A Molarity with the specified unit.
+ public Molarity ToUnit(MolarityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Molarity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ MolarityUnit.CentimolePerLiter => (_value / 1e-3) * 1e-2d,
+ MolarityUnit.DecimolePerLiter => (_value / 1e-3) * 1e-1d,
+ MolarityUnit.FemtomolePerLiter => (_value / 1e-3) * 1e-15d,
+ MolarityUnit.KilomolePerCubicMeter => (_value) * 1e3d,
+ MolarityUnit.MicromolePerLiter => (_value / 1e-3) * 1e-6d,
+ MolarityUnit.MillimolePerLiter => (_value / 1e-3) * 1e-3d,
+ MolarityUnit.MolePerCubicMeter => _value,
+ MolarityUnit.MolePerLiter => _value / 1e-3,
+ MolarityUnit.NanomolePerLiter => (_value / 1e-3) * 1e-9d,
+ MolarityUnit.PicomolePerLiter => (_value / 1e-3) * 1e-12d,
+ MolarityUnit.PoundMolePerCubicFoot => _value * 1000 * 0.45359237 / 0.028316846592,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(MolarityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ MolarityUnit.CentimolePerLiter => (baseUnitValue * 1e-3) / 1e-2d,
+ MolarityUnit.DecimolePerLiter => (baseUnitValue * 1e-3) / 1e-1d,
+ MolarityUnit.FemtomolePerLiter => (baseUnitValue * 1e-3) / 1e-15d,
+ MolarityUnit.KilomolePerCubicMeter => (baseUnitValue) / 1e3d,
+ MolarityUnit.MicromolePerLiter => (baseUnitValue * 1e-3) / 1e-6d,
+ MolarityUnit.MillimolePerLiter => (baseUnitValue * 1e-3) / 1e-3d,
+ MolarityUnit.MolePerCubicMeter => baseUnitValue,
+ MolarityUnit.MolePerLiter => baseUnitValue * 1e-3,
+ MolarityUnit.NanomolePerLiter => (baseUnitValue * 1e-3) / 1e-9d,
+ MolarityUnit.PicomolePerLiter => (baseUnitValue * 1e-3) / 1e-12d,
+ MolarityUnit.PoundMolePerCubicFoot => baseUnitValue / (1000 * 0.45359237 / 0.028316846592),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/NominalPower.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/NominalPower.g.cs
new file mode 100644
index 0000000000..ac176bfab9
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/NominalPower.g.cs
@@ -0,0 +1,304 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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 System;
+using UnitsNet.Units;
+
+namespace UnitsNet
+{
+ ///
+ ///
+ /// The nominal power is the nameplate capacity of photovoltaic (PV) devices, such as solar cells, panels and systems, and is determined by measuring the electric current and voltage in a circuit, while varying the resistance under precisely defined conditions.
+ ///
+ ///
+ /// https://en.wikipedia.org/wiki/Nominal_power_(photovoltaic)
+ ///
+ public struct NominalPower
+ {
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ private readonly double _value;
+
+ ///
+ /// The unit this quantity was constructed with.
+ ///
+ private readonly NominalPowerUnit _unit;
+
+ ///
+ /// The numeric value this quantity was constructed with.
+ ///
+ public double Value => _value;
+
+ ///
+ public NominalPowerUnit Unit => _unit;
+
+ ///
+ /// Creates the quantity with the given numeric value and unit.
+ ///
+ /// The numeric value to construct this quantity with.
+ /// The unit representation to construct this quantity with.
+ public NominalPower(double value, NominalPowerUnit unit)
+ {
+ _value = value;
+ _unit = unit;
+ }
+
+ ///
+ /// The base unit of NominalPower, which is Second. All conversions go via this value.
+ ///
+ public static NominalPowerUnit BaseUnit { get; } = NominalPowerUnit.WattPeak;
+
+ ///
+ /// Represents the largest possible value of NominalPower.
+ ///
+ public static NominalPower MaxValue { get; } = new NominalPower(double.MaxValue, BaseUnit);
+
+ ///
+ /// Represents the smallest possible value of NominalPower.
+ ///
+ public static NominalPower MinValue { get; } = new NominalPower(double.MinValue, BaseUnit);
+
+ ///
+ /// Gets an instance of this quantity with a value of 0 in the base unit Second.
+ ///
+ public static NominalPower Zero { get; } = new NominalPower(0, BaseUnit);
+ #region Conversion Properties
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double DecawattsPeak => As(NominalPowerUnit.DecawattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double DeciwattsPeak => As(NominalPowerUnit.DeciwattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double FemtowattsPeak => As(NominalPowerUnit.FemtowattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double GigawattsPeak => As(NominalPowerUnit.GigawattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double KilowattsPeak => As(NominalPowerUnit.KilowattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MegawattsPeak => As(NominalPowerUnit.MegawattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MicrowattsPeak => As(NominalPowerUnit.MicrowattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double MilliwattsPeak => As(NominalPowerUnit.MilliwattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double NanowattsPeak => As(NominalPowerUnit.NanowattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double PetawattsPeak => As(NominalPowerUnit.PetawattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double PicowattsPeak => As(NominalPowerUnit.PicowattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double TerawattsPeak => As(NominalPowerUnit.TerawattPeak);
+
+ ///
+ /// Gets a value of this quantity converted into
+ ///
+ public double WattsPeak => As(NominalPowerUnit.WattPeak);
+
+ #endregion
+
+ #region Static Factory Methods
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromDecawattsPeak(double decawattspeak) => new NominalPower(decawattspeak, NominalPowerUnit.DecawattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromDeciwattsPeak(double deciwattspeak) => new NominalPower(deciwattspeak, NominalPowerUnit.DeciwattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromFemtowattsPeak(double femtowattspeak) => new NominalPower(femtowattspeak, NominalPowerUnit.FemtowattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromGigawattsPeak(double gigawattspeak) => new NominalPower(gigawattspeak, NominalPowerUnit.GigawattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromKilowattsPeak(double kilowattspeak) => new NominalPower(kilowattspeak, NominalPowerUnit.KilowattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromMegawattsPeak(double megawattspeak) => new NominalPower(megawattspeak, NominalPowerUnit.MegawattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromMicrowattsPeak(double microwattspeak) => new NominalPower(microwattspeak, NominalPowerUnit.MicrowattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromMilliwattsPeak(double milliwattspeak) => new NominalPower(milliwattspeak, NominalPowerUnit.MilliwattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromNanowattsPeak(double nanowattspeak) => new NominalPower(nanowattspeak, NominalPowerUnit.NanowattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromPetawattsPeak(double petawattspeak) => new NominalPower(petawattspeak, NominalPowerUnit.PetawattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromPicowattsPeak(double picowattspeak) => new NominalPower(picowattspeak, NominalPowerUnit.PicowattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromTerawattsPeak(double terawattspeak) => new NominalPower(terawattspeak, NominalPowerUnit.TerawattPeak);
+
+ ///
+ /// Creates a from .
+ ///
+ public static NominalPower FromWattsPeak(double wattspeak) => new NominalPower(wattspeak, NominalPowerUnit.WattPeak);
+
+ ///
+ /// Dynamically convert from value and unit enum to .
+ ///
+ /// Value to convert from.
+ /// Unit to convert from.
+ /// NominalPower unit value.
+ public static NominalPower From(double value, NominalPowerUnit fromUnit)
+ {
+ return new NominalPower(value, fromUnit);
+ }
+
+ #endregion
+
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(NominalPowerUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this NominalPower to another NominalPower with the unit representation .
+ ///
+ /// A NominalPower with the specified unit.
+ public NominalPower ToUnit(NominalPowerUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new NominalPower(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ NominalPowerUnit.DecawattPeak => (_value) * 1e1d,
+ NominalPowerUnit.DeciwattPeak => (_value) * 1e-1d,
+ NominalPowerUnit.FemtowattPeak => (_value) * 1e-15d,
+ NominalPowerUnit.GigawattPeak => (_value) * 1e9d,
+ NominalPowerUnit.KilowattPeak => (_value) * 1e3d,
+ NominalPowerUnit.MegawattPeak => (_value) * 1e6d,
+ NominalPowerUnit.MicrowattPeak => (_value) * 1e-6d,
+ NominalPowerUnit.MilliwattPeak => (_value) * 1e-3d,
+ NominalPowerUnit.NanowattPeak => (_value) * 1e-9d,
+ NominalPowerUnit.PetawattPeak => (_value) * 1e15d,
+ NominalPowerUnit.PicowattPeak => (_value) * 1e-12d,
+ NominalPowerUnit.TerawattPeak => (_value) * 1e12d,
+ NominalPowerUnit.WattPeak => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(NominalPowerUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ NominalPowerUnit.DecawattPeak => (baseUnitValue) / 1e1d,
+ NominalPowerUnit.DeciwattPeak => (baseUnitValue) / 1e-1d,
+ NominalPowerUnit.FemtowattPeak => (baseUnitValue) / 1e-15d,
+ NominalPowerUnit.GigawattPeak => (baseUnitValue) / 1e9d,
+ NominalPowerUnit.KilowattPeak => (baseUnitValue) / 1e3d,
+ NominalPowerUnit.MegawattPeak => (baseUnitValue) / 1e6d,
+ NominalPowerUnit.MicrowattPeak => (baseUnitValue) / 1e-6d,
+ NominalPowerUnit.MilliwattPeak => (baseUnitValue) / 1e-3d,
+ NominalPowerUnit.NanowattPeak => (baseUnitValue) / 1e-9d,
+ NominalPowerUnit.PetawattPeak => (baseUnitValue) / 1e15d,
+ NominalPowerUnit.PicowattPeak => (baseUnitValue) / 1e-12d,
+ NominalPowerUnit.TerawattPeak => (baseUnitValue) / 1e12d,
+ NominalPowerUnit.WattPeak => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
+ }
+}
+
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permeability.g.cs
index 98167f4a14..4bfdbfc1c6 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permeability.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permeability.g.cs
@@ -108,53 +108,53 @@ public static Permeability From(double value, PermeabilityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PermeabilityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Permeability to another Permeability with the unit representation .
- ///
- /// A Permeability with the specified unit.
- public Permeability ToUnit(PermeabilityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Permeability(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PermeabilityUnit.HenryPerMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PermeabilityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PermeabilityUnit.HenryPerMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PermeabilityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Permeability to another Permeability with the unit representation .
+ ///
+ /// A Permeability with the specified unit.
+ public Permeability ToUnit(PermeabilityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Permeability(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PermeabilityUnit.HenryPerMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PermeabilityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PermeabilityUnit.HenryPerMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permittivity.g.cs
index 22878acd37..96e597e6e9 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permittivity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Permittivity.g.cs
@@ -108,53 +108,53 @@ public static Permittivity From(double value, PermittivityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PermittivityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Permittivity to another Permittivity with the unit representation .
- ///
- /// A Permittivity with the specified unit.
- public Permittivity ToUnit(PermittivityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Permittivity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PermittivityUnit.FaradPerMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PermittivityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PermittivityUnit.FaradPerMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PermittivityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Permittivity to another Permittivity with the unit representation .
+ ///
+ /// A Permittivity with the specified unit.
+ public Permittivity ToUnit(PermittivityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Permittivity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PermittivityUnit.FaradPerMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PermittivityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PermittivityUnit.FaradPerMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PorousMediumPermeability.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PorousMediumPermeability.g.cs
index 06676e08ae..1c3b73ecaa 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PorousMediumPermeability.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PorousMediumPermeability.g.cs
@@ -148,61 +148,61 @@ public static PorousMediumPermeability From(double value, PorousMediumPermeabili
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PorousMediumPermeabilityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this PorousMediumPermeability to another PorousMediumPermeability with the unit representation .
- ///
- /// A PorousMediumPermeability with the specified unit.
- public PorousMediumPermeability ToUnit(PorousMediumPermeabilityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new PorousMediumPermeability(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PorousMediumPermeabilityUnit.Darcy => _value * 9.869233e-13,
- PorousMediumPermeabilityUnit.Microdarcy => (_value * 9.869233e-13) * 1e-6d,
- PorousMediumPermeabilityUnit.Millidarcy => (_value * 9.869233e-13) * 1e-3d,
- PorousMediumPermeabilityUnit.SquareCentimeter => _value * 1e-4,
- PorousMediumPermeabilityUnit.SquareMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PorousMediumPermeabilityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PorousMediumPermeabilityUnit.Darcy => baseUnitValue / 9.869233e-13,
- PorousMediumPermeabilityUnit.Microdarcy => (baseUnitValue / 9.869233e-13) / 1e-6d,
- PorousMediumPermeabilityUnit.Millidarcy => (baseUnitValue / 9.869233e-13) / 1e-3d,
- PorousMediumPermeabilityUnit.SquareCentimeter => baseUnitValue / 1e-4,
- PorousMediumPermeabilityUnit.SquareMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PorousMediumPermeabilityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this PorousMediumPermeability to another PorousMediumPermeability with the unit representation .
+ ///
+ /// A PorousMediumPermeability with the specified unit.
+ public PorousMediumPermeability ToUnit(PorousMediumPermeabilityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new PorousMediumPermeability(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PorousMediumPermeabilityUnit.Darcy => _value * 9.869233e-13,
+ PorousMediumPermeabilityUnit.Microdarcy => (_value * 9.869233e-13) * 1e-6d,
+ PorousMediumPermeabilityUnit.Millidarcy => (_value * 9.869233e-13) * 1e-3d,
+ PorousMediumPermeabilityUnit.SquareCentimeter => _value * 1e-4,
+ PorousMediumPermeabilityUnit.SquareMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PorousMediumPermeabilityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PorousMediumPermeabilityUnit.Darcy => baseUnitValue / 9.869233e-13,
+ PorousMediumPermeabilityUnit.Microdarcy => (baseUnitValue / 9.869233e-13) / 1e-6d,
+ PorousMediumPermeabilityUnit.Millidarcy => (baseUnitValue / 9.869233e-13) / 1e-3d,
+ PorousMediumPermeabilityUnit.SquareCentimeter => baseUnitValue / 1e-4,
+ PorousMediumPermeabilityUnit.SquareMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Power.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Power.g.cs
index d06e73550e..f279ce6e97 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Power.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Power.g.cs
@@ -365,105 +365,105 @@ public static Power From(double value, PowerUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PowerUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Power to another Power with the unit representation .
- ///
- /// A Power with the specified unit.
- public Power ToUnit(PowerUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Power(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PowerUnit.BoilerHorsepower => _value * 9812.5,
- PowerUnit.BritishThermalUnitPerHour => _value * 1055.05585262 / 3600,
- PowerUnit.Decawatt => (_value) * 1e1d,
- PowerUnit.Deciwatt => (_value) * 1e-1d,
- PowerUnit.ElectricalHorsepower => _value * 746,
- PowerUnit.Femtowatt => (_value) * 1e-15d,
- PowerUnit.GigajoulePerHour => (_value / 3600) * 1e9d,
- PowerUnit.Gigawatt => (_value) * 1e9d,
- PowerUnit.HydraulicHorsepower => _value * 745.69987158227022,
- PowerUnit.JoulePerHour => _value / 3600,
- PowerUnit.KilobritishThermalUnitPerHour => (_value * 1055.05585262 / 3600) * 1e3d,
- PowerUnit.KilojoulePerHour => (_value / 3600) * 1e3d,
- PowerUnit.Kilowatt => (_value) * 1e3d,
- PowerUnit.MechanicalHorsepower => _value * 76.0402249 * 9.80665,
- PowerUnit.MegabritishThermalUnitPerHour => (_value * 1055.05585262 / 3600) * 1e6d,
- PowerUnit.MegajoulePerHour => (_value / 3600) * 1e6d,
- PowerUnit.Megawatt => (_value) * 1e6d,
- PowerUnit.MetricHorsepower => _value * 75 * 9.80665,
- PowerUnit.Microwatt => (_value) * 1e-6d,
- PowerUnit.MillijoulePerHour => (_value / 3600) * 1e-3d,
- PowerUnit.Milliwatt => (_value) * 1e-3d,
- PowerUnit.Nanowatt => (_value) * 1e-9d,
- PowerUnit.Petawatt => (_value) * 1e15d,
- PowerUnit.Picowatt => (_value) * 1e-12d,
- PowerUnit.Terawatt => (_value) * 1e12d,
- PowerUnit.TonOfRefrigeration => _value * 3516.853,
- PowerUnit.Watt => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PowerUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PowerUnit.BoilerHorsepower => baseUnitValue / 9812.5,
- PowerUnit.BritishThermalUnitPerHour => baseUnitValue * 3600 / 1055.05585262,
- PowerUnit.Decawatt => (baseUnitValue) / 1e1d,
- PowerUnit.Deciwatt => (baseUnitValue) / 1e-1d,
- PowerUnit.ElectricalHorsepower => baseUnitValue / 746,
- PowerUnit.Femtowatt => (baseUnitValue) / 1e-15d,
- PowerUnit.GigajoulePerHour => (baseUnitValue * 3600) / 1e9d,
- PowerUnit.Gigawatt => (baseUnitValue) / 1e9d,
- PowerUnit.HydraulicHorsepower => baseUnitValue / 745.69987158227022,
- PowerUnit.JoulePerHour => baseUnitValue * 3600,
- PowerUnit.KilobritishThermalUnitPerHour => (baseUnitValue * 3600 / 1055.05585262) / 1e3d,
- PowerUnit.KilojoulePerHour => (baseUnitValue * 3600) / 1e3d,
- PowerUnit.Kilowatt => (baseUnitValue) / 1e3d,
- PowerUnit.MechanicalHorsepower => baseUnitValue / (76.0402249 * 9.80665),
- PowerUnit.MegabritishThermalUnitPerHour => (baseUnitValue * 3600 / 1055.05585262) / 1e6d,
- PowerUnit.MegajoulePerHour => (baseUnitValue * 3600) / 1e6d,
- PowerUnit.Megawatt => (baseUnitValue) / 1e6d,
- PowerUnit.MetricHorsepower => baseUnitValue / (75 * 9.80665),
- PowerUnit.Microwatt => (baseUnitValue) / 1e-6d,
- PowerUnit.MillijoulePerHour => (baseUnitValue * 3600) / 1e-3d,
- PowerUnit.Milliwatt => (baseUnitValue) / 1e-3d,
- PowerUnit.Nanowatt => (baseUnitValue) / 1e-9d,
- PowerUnit.Petawatt => (baseUnitValue) / 1e15d,
- PowerUnit.Picowatt => (baseUnitValue) / 1e-12d,
- PowerUnit.Terawatt => (baseUnitValue) / 1e12d,
- PowerUnit.TonOfRefrigeration => baseUnitValue / 3516.853,
- PowerUnit.Watt => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PowerUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Power to another Power with the unit representation .
+ ///
+ /// A Power with the specified unit.
+ public Power ToUnit(PowerUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Power(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PowerUnit.BoilerHorsepower => _value * 9812.5,
+ PowerUnit.BritishThermalUnitPerHour => _value * 1055.05585262 / 3600,
+ PowerUnit.Decawatt => (_value) * 1e1d,
+ PowerUnit.Deciwatt => (_value) * 1e-1d,
+ PowerUnit.ElectricalHorsepower => _value * 746,
+ PowerUnit.Femtowatt => (_value) * 1e-15d,
+ PowerUnit.GigajoulePerHour => (_value / 3600) * 1e9d,
+ PowerUnit.Gigawatt => (_value) * 1e9d,
+ PowerUnit.HydraulicHorsepower => _value * 745.69987158227022,
+ PowerUnit.JoulePerHour => _value / 3600,
+ PowerUnit.KilobritishThermalUnitPerHour => (_value * 1055.05585262 / 3600) * 1e3d,
+ PowerUnit.KilojoulePerHour => (_value / 3600) * 1e3d,
+ PowerUnit.Kilowatt => (_value) * 1e3d,
+ PowerUnit.MechanicalHorsepower => _value * 76.0402249 * 9.80665,
+ PowerUnit.MegabritishThermalUnitPerHour => (_value * 1055.05585262 / 3600) * 1e6d,
+ PowerUnit.MegajoulePerHour => (_value / 3600) * 1e6d,
+ PowerUnit.Megawatt => (_value) * 1e6d,
+ PowerUnit.MetricHorsepower => _value * 75 * 9.80665,
+ PowerUnit.Microwatt => (_value) * 1e-6d,
+ PowerUnit.MillijoulePerHour => (_value / 3600) * 1e-3d,
+ PowerUnit.Milliwatt => (_value) * 1e-3d,
+ PowerUnit.Nanowatt => (_value) * 1e-9d,
+ PowerUnit.Petawatt => (_value) * 1e15d,
+ PowerUnit.Picowatt => (_value) * 1e-12d,
+ PowerUnit.Terawatt => (_value) * 1e12d,
+ PowerUnit.TonOfRefrigeration => _value * 3516.853,
+ PowerUnit.Watt => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PowerUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PowerUnit.BoilerHorsepower => baseUnitValue / 9812.5,
+ PowerUnit.BritishThermalUnitPerHour => baseUnitValue * 3600 / 1055.05585262,
+ PowerUnit.Decawatt => (baseUnitValue) / 1e1d,
+ PowerUnit.Deciwatt => (baseUnitValue) / 1e-1d,
+ PowerUnit.ElectricalHorsepower => baseUnitValue / 746,
+ PowerUnit.Femtowatt => (baseUnitValue) / 1e-15d,
+ PowerUnit.GigajoulePerHour => (baseUnitValue * 3600) / 1e9d,
+ PowerUnit.Gigawatt => (baseUnitValue) / 1e9d,
+ PowerUnit.HydraulicHorsepower => baseUnitValue / 745.69987158227022,
+ PowerUnit.JoulePerHour => baseUnitValue * 3600,
+ PowerUnit.KilobritishThermalUnitPerHour => (baseUnitValue * 3600 / 1055.05585262) / 1e3d,
+ PowerUnit.KilojoulePerHour => (baseUnitValue * 3600) / 1e3d,
+ PowerUnit.Kilowatt => (baseUnitValue) / 1e3d,
+ PowerUnit.MechanicalHorsepower => baseUnitValue / (76.0402249 * 9.80665),
+ PowerUnit.MegabritishThermalUnitPerHour => (baseUnitValue * 3600 / 1055.05585262) / 1e6d,
+ PowerUnit.MegajoulePerHour => (baseUnitValue * 3600) / 1e6d,
+ PowerUnit.Megawatt => (baseUnitValue) / 1e6d,
+ PowerUnit.MetricHorsepower => baseUnitValue / (75 * 9.80665),
+ PowerUnit.Microwatt => (baseUnitValue) / 1e-6d,
+ PowerUnit.MillijoulePerHour => (baseUnitValue * 3600) / 1e-3d,
+ PowerUnit.Milliwatt => (baseUnitValue) / 1e-3d,
+ PowerUnit.Nanowatt => (baseUnitValue) / 1e-9d,
+ PowerUnit.Petawatt => (baseUnitValue) / 1e15d,
+ PowerUnit.Picowatt => (baseUnitValue) / 1e-12d,
+ PowerUnit.Terawatt => (baseUnitValue) / 1e12d,
+ PowerUnit.TonOfRefrigeration => baseUnitValue / 3516.853,
+ PowerUnit.Watt => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerDensity.g.cs
index 0ad6bd97a9..24aacb369c 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerDensity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerDensity.g.cs
@@ -535,139 +535,139 @@ public static PowerDensity From(double value, PowerDensityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PowerDensityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this PowerDensity to another PowerDensity with the unit representation .
- ///
- /// A PowerDensity with the specified unit.
- public PowerDensity ToUnit(PowerDensityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new PowerDensity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PowerDensityUnit.DecawattPerCubicFoot => (_value / 0.028316846592) * 1e1d,
- PowerDensityUnit.DecawattPerCubicInch => (_value / 1.6387064e-5) * 1e1d,
- PowerDensityUnit.DecawattPerCubicMeter => (_value) * 1e1d,
- PowerDensityUnit.DecawattPerLiter => (_value * 1.0e3) * 1e1d,
- PowerDensityUnit.DeciwattPerCubicFoot => (_value / 0.028316846592) * 1e-1d,
- PowerDensityUnit.DeciwattPerCubicInch => (_value / 1.6387064e-5) * 1e-1d,
- PowerDensityUnit.DeciwattPerCubicMeter => (_value) * 1e-1d,
- PowerDensityUnit.DeciwattPerLiter => (_value * 1.0e3) * 1e-1d,
- PowerDensityUnit.GigawattPerCubicFoot => (_value / 0.028316846592) * 1e9d,
- PowerDensityUnit.GigawattPerCubicInch => (_value / 1.6387064e-5) * 1e9d,
- PowerDensityUnit.GigawattPerCubicMeter => (_value) * 1e9d,
- PowerDensityUnit.GigawattPerLiter => (_value * 1.0e3) * 1e9d,
- PowerDensityUnit.KilowattPerCubicFoot => (_value / 0.028316846592) * 1e3d,
- PowerDensityUnit.KilowattPerCubicInch => (_value / 1.6387064e-5) * 1e3d,
- PowerDensityUnit.KilowattPerCubicMeter => (_value) * 1e3d,
- PowerDensityUnit.KilowattPerLiter => (_value * 1.0e3) * 1e3d,
- PowerDensityUnit.MegawattPerCubicFoot => (_value / 0.028316846592) * 1e6d,
- PowerDensityUnit.MegawattPerCubicInch => (_value / 1.6387064e-5) * 1e6d,
- PowerDensityUnit.MegawattPerCubicMeter => (_value) * 1e6d,
- PowerDensityUnit.MegawattPerLiter => (_value * 1.0e3) * 1e6d,
- PowerDensityUnit.MicrowattPerCubicFoot => (_value / 0.028316846592) * 1e-6d,
- PowerDensityUnit.MicrowattPerCubicInch => (_value / 1.6387064e-5) * 1e-6d,
- PowerDensityUnit.MicrowattPerCubicMeter => (_value) * 1e-6d,
- PowerDensityUnit.MicrowattPerLiter => (_value * 1.0e3) * 1e-6d,
- PowerDensityUnit.MilliwattPerCubicFoot => (_value / 0.028316846592) * 1e-3d,
- PowerDensityUnit.MilliwattPerCubicInch => (_value / 1.6387064e-5) * 1e-3d,
- PowerDensityUnit.MilliwattPerCubicMeter => (_value) * 1e-3d,
- PowerDensityUnit.MilliwattPerLiter => (_value * 1.0e3) * 1e-3d,
- PowerDensityUnit.NanowattPerCubicFoot => (_value / 0.028316846592) * 1e-9d,
- PowerDensityUnit.NanowattPerCubicInch => (_value / 1.6387064e-5) * 1e-9d,
- PowerDensityUnit.NanowattPerCubicMeter => (_value) * 1e-9d,
- PowerDensityUnit.NanowattPerLiter => (_value * 1.0e3) * 1e-9d,
- PowerDensityUnit.PicowattPerCubicFoot => (_value / 0.028316846592) * 1e-12d,
- PowerDensityUnit.PicowattPerCubicInch => (_value / 1.6387064e-5) * 1e-12d,
- PowerDensityUnit.PicowattPerCubicMeter => (_value) * 1e-12d,
- PowerDensityUnit.PicowattPerLiter => (_value * 1.0e3) * 1e-12d,
- PowerDensityUnit.TerawattPerCubicFoot => (_value / 0.028316846592) * 1e12d,
- PowerDensityUnit.TerawattPerCubicInch => (_value / 1.6387064e-5) * 1e12d,
- PowerDensityUnit.TerawattPerCubicMeter => (_value) * 1e12d,
- PowerDensityUnit.TerawattPerLiter => (_value * 1.0e3) * 1e12d,
- PowerDensityUnit.WattPerCubicFoot => _value / 0.028316846592,
- PowerDensityUnit.WattPerCubicInch => _value / 1.6387064e-5,
- PowerDensityUnit.WattPerCubicMeter => _value,
- PowerDensityUnit.WattPerLiter => _value * 1.0e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PowerDensityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PowerDensityUnit.DecawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e1d,
- PowerDensityUnit.DecawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e1d,
- PowerDensityUnit.DecawattPerCubicMeter => (baseUnitValue) / 1e1d,
- PowerDensityUnit.DecawattPerLiter => (baseUnitValue / 1.0e3) / 1e1d,
- PowerDensityUnit.DeciwattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-1d,
- PowerDensityUnit.DeciwattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-1d,
- PowerDensityUnit.DeciwattPerCubicMeter => (baseUnitValue) / 1e-1d,
- PowerDensityUnit.DeciwattPerLiter => (baseUnitValue / 1.0e3) / 1e-1d,
- PowerDensityUnit.GigawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e9d,
- PowerDensityUnit.GigawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e9d,
- PowerDensityUnit.GigawattPerCubicMeter => (baseUnitValue) / 1e9d,
- PowerDensityUnit.GigawattPerLiter => (baseUnitValue / 1.0e3) / 1e9d,
- PowerDensityUnit.KilowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e3d,
- PowerDensityUnit.KilowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e3d,
- PowerDensityUnit.KilowattPerCubicMeter => (baseUnitValue) / 1e3d,
- PowerDensityUnit.KilowattPerLiter => (baseUnitValue / 1.0e3) / 1e3d,
- PowerDensityUnit.MegawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e6d,
- PowerDensityUnit.MegawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e6d,
- PowerDensityUnit.MegawattPerCubicMeter => (baseUnitValue) / 1e6d,
- PowerDensityUnit.MegawattPerLiter => (baseUnitValue / 1.0e3) / 1e6d,
- PowerDensityUnit.MicrowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-6d,
- PowerDensityUnit.MicrowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-6d,
- PowerDensityUnit.MicrowattPerCubicMeter => (baseUnitValue) / 1e-6d,
- PowerDensityUnit.MicrowattPerLiter => (baseUnitValue / 1.0e3) / 1e-6d,
- PowerDensityUnit.MilliwattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-3d,
- PowerDensityUnit.MilliwattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-3d,
- PowerDensityUnit.MilliwattPerCubicMeter => (baseUnitValue) / 1e-3d,
- PowerDensityUnit.MilliwattPerLiter => (baseUnitValue / 1.0e3) / 1e-3d,
- PowerDensityUnit.NanowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-9d,
- PowerDensityUnit.NanowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-9d,
- PowerDensityUnit.NanowattPerCubicMeter => (baseUnitValue) / 1e-9d,
- PowerDensityUnit.NanowattPerLiter => (baseUnitValue / 1.0e3) / 1e-9d,
- PowerDensityUnit.PicowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-12d,
- PowerDensityUnit.PicowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-12d,
- PowerDensityUnit.PicowattPerCubicMeter => (baseUnitValue) / 1e-12d,
- PowerDensityUnit.PicowattPerLiter => (baseUnitValue / 1.0e3) / 1e-12d,
- PowerDensityUnit.TerawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e12d,
- PowerDensityUnit.TerawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e12d,
- PowerDensityUnit.TerawattPerCubicMeter => (baseUnitValue) / 1e12d,
- PowerDensityUnit.TerawattPerLiter => (baseUnitValue / 1.0e3) / 1e12d,
- PowerDensityUnit.WattPerCubicFoot => baseUnitValue * 0.028316846592,
- PowerDensityUnit.WattPerCubicInch => baseUnitValue * 1.6387064e-5,
- PowerDensityUnit.WattPerCubicMeter => baseUnitValue,
- PowerDensityUnit.WattPerLiter => baseUnitValue / 1.0e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PowerDensityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this PowerDensity to another PowerDensity with the unit representation .
+ ///
+ /// A PowerDensity with the specified unit.
+ public PowerDensity ToUnit(PowerDensityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new PowerDensity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PowerDensityUnit.DecawattPerCubicFoot => (_value / 0.028316846592) * 1e1d,
+ PowerDensityUnit.DecawattPerCubicInch => (_value / 1.6387064e-5) * 1e1d,
+ PowerDensityUnit.DecawattPerCubicMeter => (_value) * 1e1d,
+ PowerDensityUnit.DecawattPerLiter => (_value * 1.0e3) * 1e1d,
+ PowerDensityUnit.DeciwattPerCubicFoot => (_value / 0.028316846592) * 1e-1d,
+ PowerDensityUnit.DeciwattPerCubicInch => (_value / 1.6387064e-5) * 1e-1d,
+ PowerDensityUnit.DeciwattPerCubicMeter => (_value) * 1e-1d,
+ PowerDensityUnit.DeciwattPerLiter => (_value * 1.0e3) * 1e-1d,
+ PowerDensityUnit.GigawattPerCubicFoot => (_value / 0.028316846592) * 1e9d,
+ PowerDensityUnit.GigawattPerCubicInch => (_value / 1.6387064e-5) * 1e9d,
+ PowerDensityUnit.GigawattPerCubicMeter => (_value) * 1e9d,
+ PowerDensityUnit.GigawattPerLiter => (_value * 1.0e3) * 1e9d,
+ PowerDensityUnit.KilowattPerCubicFoot => (_value / 0.028316846592) * 1e3d,
+ PowerDensityUnit.KilowattPerCubicInch => (_value / 1.6387064e-5) * 1e3d,
+ PowerDensityUnit.KilowattPerCubicMeter => (_value) * 1e3d,
+ PowerDensityUnit.KilowattPerLiter => (_value * 1.0e3) * 1e3d,
+ PowerDensityUnit.MegawattPerCubicFoot => (_value / 0.028316846592) * 1e6d,
+ PowerDensityUnit.MegawattPerCubicInch => (_value / 1.6387064e-5) * 1e6d,
+ PowerDensityUnit.MegawattPerCubicMeter => (_value) * 1e6d,
+ PowerDensityUnit.MegawattPerLiter => (_value * 1.0e3) * 1e6d,
+ PowerDensityUnit.MicrowattPerCubicFoot => (_value / 0.028316846592) * 1e-6d,
+ PowerDensityUnit.MicrowattPerCubicInch => (_value / 1.6387064e-5) * 1e-6d,
+ PowerDensityUnit.MicrowattPerCubicMeter => (_value) * 1e-6d,
+ PowerDensityUnit.MicrowattPerLiter => (_value * 1.0e3) * 1e-6d,
+ PowerDensityUnit.MilliwattPerCubicFoot => (_value / 0.028316846592) * 1e-3d,
+ PowerDensityUnit.MilliwattPerCubicInch => (_value / 1.6387064e-5) * 1e-3d,
+ PowerDensityUnit.MilliwattPerCubicMeter => (_value) * 1e-3d,
+ PowerDensityUnit.MilliwattPerLiter => (_value * 1.0e3) * 1e-3d,
+ PowerDensityUnit.NanowattPerCubicFoot => (_value / 0.028316846592) * 1e-9d,
+ PowerDensityUnit.NanowattPerCubicInch => (_value / 1.6387064e-5) * 1e-9d,
+ PowerDensityUnit.NanowattPerCubicMeter => (_value) * 1e-9d,
+ PowerDensityUnit.NanowattPerLiter => (_value * 1.0e3) * 1e-9d,
+ PowerDensityUnit.PicowattPerCubicFoot => (_value / 0.028316846592) * 1e-12d,
+ PowerDensityUnit.PicowattPerCubicInch => (_value / 1.6387064e-5) * 1e-12d,
+ PowerDensityUnit.PicowattPerCubicMeter => (_value) * 1e-12d,
+ PowerDensityUnit.PicowattPerLiter => (_value * 1.0e3) * 1e-12d,
+ PowerDensityUnit.TerawattPerCubicFoot => (_value / 0.028316846592) * 1e12d,
+ PowerDensityUnit.TerawattPerCubicInch => (_value / 1.6387064e-5) * 1e12d,
+ PowerDensityUnit.TerawattPerCubicMeter => (_value) * 1e12d,
+ PowerDensityUnit.TerawattPerLiter => (_value * 1.0e3) * 1e12d,
+ PowerDensityUnit.WattPerCubicFoot => _value / 0.028316846592,
+ PowerDensityUnit.WattPerCubicInch => _value / 1.6387064e-5,
+ PowerDensityUnit.WattPerCubicMeter => _value,
+ PowerDensityUnit.WattPerLiter => _value * 1.0e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PowerDensityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PowerDensityUnit.DecawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e1d,
+ PowerDensityUnit.DecawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e1d,
+ PowerDensityUnit.DecawattPerCubicMeter => (baseUnitValue) / 1e1d,
+ PowerDensityUnit.DecawattPerLiter => (baseUnitValue / 1.0e3) / 1e1d,
+ PowerDensityUnit.DeciwattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-1d,
+ PowerDensityUnit.DeciwattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-1d,
+ PowerDensityUnit.DeciwattPerCubicMeter => (baseUnitValue) / 1e-1d,
+ PowerDensityUnit.DeciwattPerLiter => (baseUnitValue / 1.0e3) / 1e-1d,
+ PowerDensityUnit.GigawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e9d,
+ PowerDensityUnit.GigawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e9d,
+ PowerDensityUnit.GigawattPerCubicMeter => (baseUnitValue) / 1e9d,
+ PowerDensityUnit.GigawattPerLiter => (baseUnitValue / 1.0e3) / 1e9d,
+ PowerDensityUnit.KilowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e3d,
+ PowerDensityUnit.KilowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e3d,
+ PowerDensityUnit.KilowattPerCubicMeter => (baseUnitValue) / 1e3d,
+ PowerDensityUnit.KilowattPerLiter => (baseUnitValue / 1.0e3) / 1e3d,
+ PowerDensityUnit.MegawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e6d,
+ PowerDensityUnit.MegawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e6d,
+ PowerDensityUnit.MegawattPerCubicMeter => (baseUnitValue) / 1e6d,
+ PowerDensityUnit.MegawattPerLiter => (baseUnitValue / 1.0e3) / 1e6d,
+ PowerDensityUnit.MicrowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-6d,
+ PowerDensityUnit.MicrowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-6d,
+ PowerDensityUnit.MicrowattPerCubicMeter => (baseUnitValue) / 1e-6d,
+ PowerDensityUnit.MicrowattPerLiter => (baseUnitValue / 1.0e3) / 1e-6d,
+ PowerDensityUnit.MilliwattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-3d,
+ PowerDensityUnit.MilliwattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-3d,
+ PowerDensityUnit.MilliwattPerCubicMeter => (baseUnitValue) / 1e-3d,
+ PowerDensityUnit.MilliwattPerLiter => (baseUnitValue / 1.0e3) / 1e-3d,
+ PowerDensityUnit.NanowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-9d,
+ PowerDensityUnit.NanowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-9d,
+ PowerDensityUnit.NanowattPerCubicMeter => (baseUnitValue) / 1e-9d,
+ PowerDensityUnit.NanowattPerLiter => (baseUnitValue / 1.0e3) / 1e-9d,
+ PowerDensityUnit.PicowattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e-12d,
+ PowerDensityUnit.PicowattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e-12d,
+ PowerDensityUnit.PicowattPerCubicMeter => (baseUnitValue) / 1e-12d,
+ PowerDensityUnit.PicowattPerLiter => (baseUnitValue / 1.0e3) / 1e-12d,
+ PowerDensityUnit.TerawattPerCubicFoot => (baseUnitValue * 0.028316846592) / 1e12d,
+ PowerDensityUnit.TerawattPerCubicInch => (baseUnitValue * 1.6387064e-5) / 1e12d,
+ PowerDensityUnit.TerawattPerCubicMeter => (baseUnitValue) / 1e12d,
+ PowerDensityUnit.TerawattPerLiter => (baseUnitValue / 1.0e3) / 1e12d,
+ PowerDensityUnit.WattPerCubicFoot => baseUnitValue * 0.028316846592,
+ PowerDensityUnit.WattPerCubicInch => baseUnitValue * 1.6387064e-5,
+ PowerDensityUnit.WattPerCubicMeter => baseUnitValue,
+ PowerDensityUnit.WattPerLiter => baseUnitValue / 1.0e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerRatio.g.cs
index 5cd1825e49..48860a0c53 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerRatio.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PowerRatio.g.cs
@@ -115,55 +115,55 @@ public static PowerRatio From(double value, PowerRatioUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PowerRatioUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this PowerRatio to another PowerRatio with the unit representation .
- ///
- /// A PowerRatio with the specified unit.
- public PowerRatio ToUnit(PowerRatioUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new PowerRatio(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PowerRatioUnit.DecibelMilliwatt => _value - 30,
- PowerRatioUnit.DecibelWatt => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PowerRatioUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PowerRatioUnit.DecibelMilliwatt => baseUnitValue + 30,
- PowerRatioUnit.DecibelWatt => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PowerRatioUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this PowerRatio to another PowerRatio with the unit representation .
+ ///
+ /// A PowerRatio with the specified unit.
+ public PowerRatio ToUnit(PowerRatioUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new PowerRatio(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PowerRatioUnit.DecibelMilliwatt => _value - 30,
+ PowerRatioUnit.DecibelWatt => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PowerRatioUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PowerRatioUnit.DecibelMilliwatt => baseUnitValue + 30,
+ PowerRatioUnit.DecibelWatt => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Pressure.g.cs
index 84fa430f11..e6d2e3b182 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Pressure.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Pressure.g.cs
@@ -575,147 +575,147 @@ public static Pressure From(double value, PressureUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PressureUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Pressure to another Pressure with the unit representation .
- ///
- /// A Pressure with the specified unit.
- public Pressure ToUnit(PressureUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Pressure(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PressureUnit.Atmosphere => _value * 1.01325 * 1e5,
- PressureUnit.Bar => _value * 1e5,
- PressureUnit.Centibar => (_value * 1e5) * 1e-2d,
- PressureUnit.CentimeterOfWaterColumn => (_value * 9.80665e3) * 1e-2d,
- PressureUnit.Decapascal => (_value) * 1e1d,
- PressureUnit.Decibar => (_value * 1e5) * 1e-1d,
- PressureUnit.DynePerSquareCentimeter => _value * 1.0e-1,
- PressureUnit.FootOfHead => _value * 9804.139432 * 0.3048,
- PressureUnit.Gigapascal => (_value) * 1e9d,
- PressureUnit.Hectopascal => (_value) * 1e2d,
- PressureUnit.InchOfMercury => _value * 2.54e1 * 133.322387415,
- PressureUnit.InchOfWaterColumn => _value * 2.54e-2 * 9.80665e3,
- PressureUnit.Kilobar => (_value * 1e5) * 1e3d,
- PressureUnit.KilogramForcePerSquareCentimeter => _value * 9.80665e4,
- PressureUnit.KilogramForcePerSquareMeter => _value * 9.80665,
- PressureUnit.KilogramForcePerSquareMillimeter => _value * 9.80665e6,
- PressureUnit.KilonewtonPerSquareCentimeter => (_value * 1e4) * 1e3d,
- PressureUnit.KilonewtonPerSquareMeter => (_value) * 1e3d,
- PressureUnit.KilonewtonPerSquareMillimeter => (_value * 1e6) * 1e3d,
- PressureUnit.Kilopascal => (_value) * 1e3d,
- PressureUnit.KilopoundForcePerSquareFoot => (_value * 4.4482216152605 / 9.290304e-2) * 1e3d,
- PressureUnit.KilopoundForcePerSquareInch => (_value * 4.4482216152605 / 0.00064516) * 1e3d,
- PressureUnit.KilopoundForcePerSquareMil => (_value * 4.4482216152605 / (2.54e-5 * 2.54e-5)) * 1e3d,
- PressureUnit.Megabar => (_value * 1e5) * 1e6d,
- PressureUnit.MeganewtonPerSquareMeter => (_value) * 1e6d,
- PressureUnit.Megapascal => (_value) * 1e6d,
- PressureUnit.MeterOfHead => _value * 9804.139432,
- PressureUnit.MeterOfWaterColumn => _value * 9.80665e3,
- PressureUnit.Microbar => (_value * 1e5) * 1e-6d,
- PressureUnit.Micropascal => (_value) * 1e-6d,
- PressureUnit.Millibar => (_value * 1e5) * 1e-3d,
- PressureUnit.MillimeterOfMercury => _value * 133.322387415,
- PressureUnit.MillimeterOfWaterColumn => (_value * 9.80665e3) * 1e-3d,
- PressureUnit.Millipascal => (_value) * 1e-3d,
- PressureUnit.Millitorr => (_value * 101325 / 760) * 1e-3d,
- PressureUnit.NewtonPerSquareCentimeter => _value * 1e4,
- PressureUnit.NewtonPerSquareMeter => _value,
- PressureUnit.NewtonPerSquareMillimeter => _value * 1e6,
- PressureUnit.Pascal => _value,
- PressureUnit.PoundForcePerSquareFoot => _value * 4.4482216152605 / 9.290304e-2,
- PressureUnit.PoundForcePerSquareInch => _value * 4.4482216152605 / 0.00064516,
- PressureUnit.PoundForcePerSquareMil => _value * 4.4482216152605 / (2.54e-5 * 2.54e-5),
- PressureUnit.PoundPerInchSecondSquared => _value * (4.4482216152605 / 0.00064516) / 386.0886,
- PressureUnit.TechnicalAtmosphere => _value * 9.80665e4,
- PressureUnit.TonneForcePerSquareCentimeter => _value * 9.80665e7,
- PressureUnit.TonneForcePerSquareMeter => _value * 9.80665e3,
- PressureUnit.TonneForcePerSquareMillimeter => _value * 9.80665e9,
- PressureUnit.Torr => _value * 101325 / 760,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PressureUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PressureUnit.Atmosphere => baseUnitValue / (1.01325 * 1e5),
- PressureUnit.Bar => baseUnitValue / 1e5,
- PressureUnit.Centibar => (baseUnitValue / 1e5) / 1e-2d,
- PressureUnit.CentimeterOfWaterColumn => (baseUnitValue / 9.80665e3) / 1e-2d,
- PressureUnit.Decapascal => (baseUnitValue) / 1e1d,
- PressureUnit.Decibar => (baseUnitValue / 1e5) / 1e-1d,
- PressureUnit.DynePerSquareCentimeter => baseUnitValue / 1.0e-1,
- PressureUnit.FootOfHead => baseUnitValue / (9804.139432 * 0.3048),
- PressureUnit.Gigapascal => (baseUnitValue) / 1e9d,
- PressureUnit.Hectopascal => (baseUnitValue) / 1e2d,
- PressureUnit.InchOfMercury => baseUnitValue / (2.54e1 * 133.322387415),
- PressureUnit.InchOfWaterColumn => baseUnitValue / (2.54e-2 * 9.80665e3),
- PressureUnit.Kilobar => (baseUnitValue / 1e5) / 1e3d,
- PressureUnit.KilogramForcePerSquareCentimeter => baseUnitValue / 9.80665e4,
- PressureUnit.KilogramForcePerSquareMeter => baseUnitValue / 9.80665,
- PressureUnit.KilogramForcePerSquareMillimeter => baseUnitValue / 9.80665e6,
- PressureUnit.KilonewtonPerSquareCentimeter => (baseUnitValue / 1e4) / 1e3d,
- PressureUnit.KilonewtonPerSquareMeter => (baseUnitValue) / 1e3d,
- PressureUnit.KilonewtonPerSquareMillimeter => (baseUnitValue / 1e6) / 1e3d,
- PressureUnit.Kilopascal => (baseUnitValue) / 1e3d,
- PressureUnit.KilopoundForcePerSquareFoot => (baseUnitValue * 9.290304e-2 / 4.4482216152605) / 1e3d,
- PressureUnit.KilopoundForcePerSquareInch => (baseUnitValue * 0.00064516 / 4.4482216152605) / 1e3d,
- PressureUnit.KilopoundForcePerSquareMil => (baseUnitValue * (2.54e-5 * 2.54e-5) / 4.4482216152605) / 1e3d,
- PressureUnit.Megabar => (baseUnitValue / 1e5) / 1e6d,
- PressureUnit.MeganewtonPerSquareMeter => (baseUnitValue) / 1e6d,
- PressureUnit.Megapascal => (baseUnitValue) / 1e6d,
- PressureUnit.MeterOfHead => baseUnitValue / 9804.139432,
- PressureUnit.MeterOfWaterColumn => baseUnitValue / 9.80665e3,
- PressureUnit.Microbar => (baseUnitValue / 1e5) / 1e-6d,
- PressureUnit.Micropascal => (baseUnitValue) / 1e-6d,
- PressureUnit.Millibar => (baseUnitValue / 1e5) / 1e-3d,
- PressureUnit.MillimeterOfMercury => baseUnitValue / 133.322387415,
- PressureUnit.MillimeterOfWaterColumn => (baseUnitValue / 9.80665e3) / 1e-3d,
- PressureUnit.Millipascal => (baseUnitValue) / 1e-3d,
- PressureUnit.Millitorr => (baseUnitValue * 760 / 101325) / 1e-3d,
- PressureUnit.NewtonPerSquareCentimeter => baseUnitValue / 1e4,
- PressureUnit.NewtonPerSquareMeter => baseUnitValue,
- PressureUnit.NewtonPerSquareMillimeter => baseUnitValue / 1e6,
- PressureUnit.Pascal => baseUnitValue,
- PressureUnit.PoundForcePerSquareFoot => baseUnitValue * 9.290304e-2 / 4.4482216152605,
- PressureUnit.PoundForcePerSquareInch => baseUnitValue * 0.00064516 / 4.4482216152605,
- PressureUnit.PoundForcePerSquareMil => baseUnitValue * (2.54e-5 * 2.54e-5) / 4.4482216152605,
- PressureUnit.PoundPerInchSecondSquared => baseUnitValue * 386.0886 / (4.4482216152605 / 0.00064516),
- PressureUnit.TechnicalAtmosphere => baseUnitValue / 9.80665e4,
- PressureUnit.TonneForcePerSquareCentimeter => baseUnitValue / 9.80665e7,
- PressureUnit.TonneForcePerSquareMeter => baseUnitValue / 9.80665e3,
- PressureUnit.TonneForcePerSquareMillimeter => baseUnitValue / 9.80665e9,
- PressureUnit.Torr => baseUnitValue * 760 / 101325,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PressureUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Pressure to another Pressure with the unit representation .
+ ///
+ /// A Pressure with the specified unit.
+ public Pressure ToUnit(PressureUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Pressure(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PressureUnit.Atmosphere => _value * 1.01325 * 1e5,
+ PressureUnit.Bar => _value * 1e5,
+ PressureUnit.Centibar => (_value * 1e5) * 1e-2d,
+ PressureUnit.CentimeterOfWaterColumn => (_value * 9.80665e3) * 1e-2d,
+ PressureUnit.Decapascal => (_value) * 1e1d,
+ PressureUnit.Decibar => (_value * 1e5) * 1e-1d,
+ PressureUnit.DynePerSquareCentimeter => _value * 1.0e-1,
+ PressureUnit.FootOfHead => _value * 9804.139432 * 0.3048,
+ PressureUnit.Gigapascal => (_value) * 1e9d,
+ PressureUnit.Hectopascal => (_value) * 1e2d,
+ PressureUnit.InchOfMercury => _value * 2.54e1 * 133.322387415,
+ PressureUnit.InchOfWaterColumn => _value * 2.54e-2 * 9.80665e3,
+ PressureUnit.Kilobar => (_value * 1e5) * 1e3d,
+ PressureUnit.KilogramForcePerSquareCentimeter => _value * 9.80665e4,
+ PressureUnit.KilogramForcePerSquareMeter => _value * 9.80665,
+ PressureUnit.KilogramForcePerSquareMillimeter => _value * 9.80665e6,
+ PressureUnit.KilonewtonPerSquareCentimeter => (_value * 1e4) * 1e3d,
+ PressureUnit.KilonewtonPerSquareMeter => (_value) * 1e3d,
+ PressureUnit.KilonewtonPerSquareMillimeter => (_value * 1e6) * 1e3d,
+ PressureUnit.Kilopascal => (_value) * 1e3d,
+ PressureUnit.KilopoundForcePerSquareFoot => (_value * 4.4482216152605 / 9.290304e-2) * 1e3d,
+ PressureUnit.KilopoundForcePerSquareInch => (_value * 4.4482216152605 / 0.00064516) * 1e3d,
+ PressureUnit.KilopoundForcePerSquareMil => (_value * 4.4482216152605 / (2.54e-5 * 2.54e-5)) * 1e3d,
+ PressureUnit.Megabar => (_value * 1e5) * 1e6d,
+ PressureUnit.MeganewtonPerSquareMeter => (_value) * 1e6d,
+ PressureUnit.Megapascal => (_value) * 1e6d,
+ PressureUnit.MeterOfHead => _value * 9804.139432,
+ PressureUnit.MeterOfWaterColumn => _value * 9.80665e3,
+ PressureUnit.Microbar => (_value * 1e5) * 1e-6d,
+ PressureUnit.Micropascal => (_value) * 1e-6d,
+ PressureUnit.Millibar => (_value * 1e5) * 1e-3d,
+ PressureUnit.MillimeterOfMercury => _value * 133.322387415,
+ PressureUnit.MillimeterOfWaterColumn => (_value * 9.80665e3) * 1e-3d,
+ PressureUnit.Millipascal => (_value) * 1e-3d,
+ PressureUnit.Millitorr => (_value * 101325 / 760) * 1e-3d,
+ PressureUnit.NewtonPerSquareCentimeter => _value * 1e4,
+ PressureUnit.NewtonPerSquareMeter => _value,
+ PressureUnit.NewtonPerSquareMillimeter => _value * 1e6,
+ PressureUnit.Pascal => _value,
+ PressureUnit.PoundForcePerSquareFoot => _value * 4.4482216152605 / 9.290304e-2,
+ PressureUnit.PoundForcePerSquareInch => _value * 4.4482216152605 / 0.00064516,
+ PressureUnit.PoundForcePerSquareMil => _value * 4.4482216152605 / (2.54e-5 * 2.54e-5),
+ PressureUnit.PoundPerInchSecondSquared => _value * (4.4482216152605 / 0.00064516) / 386.0886,
+ PressureUnit.TechnicalAtmosphere => _value * 9.80665e4,
+ PressureUnit.TonneForcePerSquareCentimeter => _value * 9.80665e7,
+ PressureUnit.TonneForcePerSquareMeter => _value * 9.80665e3,
+ PressureUnit.TonneForcePerSquareMillimeter => _value * 9.80665e9,
+ PressureUnit.Torr => _value * 101325 / 760,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PressureUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PressureUnit.Atmosphere => baseUnitValue / (1.01325 * 1e5),
+ PressureUnit.Bar => baseUnitValue / 1e5,
+ PressureUnit.Centibar => (baseUnitValue / 1e5) / 1e-2d,
+ PressureUnit.CentimeterOfWaterColumn => (baseUnitValue / 9.80665e3) / 1e-2d,
+ PressureUnit.Decapascal => (baseUnitValue) / 1e1d,
+ PressureUnit.Decibar => (baseUnitValue / 1e5) / 1e-1d,
+ PressureUnit.DynePerSquareCentimeter => baseUnitValue / 1.0e-1,
+ PressureUnit.FootOfHead => baseUnitValue / (9804.139432 * 0.3048),
+ PressureUnit.Gigapascal => (baseUnitValue) / 1e9d,
+ PressureUnit.Hectopascal => (baseUnitValue) / 1e2d,
+ PressureUnit.InchOfMercury => baseUnitValue / (2.54e1 * 133.322387415),
+ PressureUnit.InchOfWaterColumn => baseUnitValue / (2.54e-2 * 9.80665e3),
+ PressureUnit.Kilobar => (baseUnitValue / 1e5) / 1e3d,
+ PressureUnit.KilogramForcePerSquareCentimeter => baseUnitValue / 9.80665e4,
+ PressureUnit.KilogramForcePerSquareMeter => baseUnitValue / 9.80665,
+ PressureUnit.KilogramForcePerSquareMillimeter => baseUnitValue / 9.80665e6,
+ PressureUnit.KilonewtonPerSquareCentimeter => (baseUnitValue / 1e4) / 1e3d,
+ PressureUnit.KilonewtonPerSquareMeter => (baseUnitValue) / 1e3d,
+ PressureUnit.KilonewtonPerSquareMillimeter => (baseUnitValue / 1e6) / 1e3d,
+ PressureUnit.Kilopascal => (baseUnitValue) / 1e3d,
+ PressureUnit.KilopoundForcePerSquareFoot => (baseUnitValue * 9.290304e-2 / 4.4482216152605) / 1e3d,
+ PressureUnit.KilopoundForcePerSquareInch => (baseUnitValue * 0.00064516 / 4.4482216152605) / 1e3d,
+ PressureUnit.KilopoundForcePerSquareMil => (baseUnitValue * (2.54e-5 * 2.54e-5) / 4.4482216152605) / 1e3d,
+ PressureUnit.Megabar => (baseUnitValue / 1e5) / 1e6d,
+ PressureUnit.MeganewtonPerSquareMeter => (baseUnitValue) / 1e6d,
+ PressureUnit.Megapascal => (baseUnitValue) / 1e6d,
+ PressureUnit.MeterOfHead => baseUnitValue / 9804.139432,
+ PressureUnit.MeterOfWaterColumn => baseUnitValue / 9.80665e3,
+ PressureUnit.Microbar => (baseUnitValue / 1e5) / 1e-6d,
+ PressureUnit.Micropascal => (baseUnitValue) / 1e-6d,
+ PressureUnit.Millibar => (baseUnitValue / 1e5) / 1e-3d,
+ PressureUnit.MillimeterOfMercury => baseUnitValue / 133.322387415,
+ PressureUnit.MillimeterOfWaterColumn => (baseUnitValue / 9.80665e3) / 1e-3d,
+ PressureUnit.Millipascal => (baseUnitValue) / 1e-3d,
+ PressureUnit.Millitorr => (baseUnitValue * 760 / 101325) / 1e-3d,
+ PressureUnit.NewtonPerSquareCentimeter => baseUnitValue / 1e4,
+ PressureUnit.NewtonPerSquareMeter => baseUnitValue,
+ PressureUnit.NewtonPerSquareMillimeter => baseUnitValue / 1e6,
+ PressureUnit.Pascal => baseUnitValue,
+ PressureUnit.PoundForcePerSquareFoot => baseUnitValue * 9.290304e-2 / 4.4482216152605,
+ PressureUnit.PoundForcePerSquareInch => baseUnitValue * 0.00064516 / 4.4482216152605,
+ PressureUnit.PoundForcePerSquareMil => baseUnitValue * (2.54e-5 * 2.54e-5) / 4.4482216152605,
+ PressureUnit.PoundPerInchSecondSquared => baseUnitValue * 386.0886 / (4.4482216152605 / 0.00064516),
+ PressureUnit.TechnicalAtmosphere => baseUnitValue / 9.80665e4,
+ PressureUnit.TonneForcePerSquareCentimeter => baseUnitValue / 9.80665e7,
+ PressureUnit.TonneForcePerSquareMeter => baseUnitValue / 9.80665e3,
+ PressureUnit.TonneForcePerSquareMillimeter => baseUnitValue / 9.80665e9,
+ PressureUnit.Torr => baseUnitValue * 760 / 101325,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PressureChangeRate.g.cs
index c5547c401d..7fad0b96cd 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/PressureChangeRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/PressureChangeRate.g.cs
@@ -275,87 +275,87 @@ public static PressureChangeRate From(double value, PressureChangeRateUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(PressureChangeRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this PressureChangeRate to another PressureChangeRate with the unit representation .
- ///
- /// A PressureChangeRate with the specified unit.
- public PressureChangeRate ToUnit(PressureChangeRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new PressureChangeRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- PressureChangeRateUnit.AtmospherePerSecond => _value * 1.01325 * 1e5,
- PressureChangeRateUnit.BarPerMinute => _value * 1e5 / 60,
- PressureChangeRateUnit.BarPerSecond => _value * 1e5,
- PressureChangeRateUnit.KilopascalPerMinute => (_value / 60) * 1e3d,
- PressureChangeRateUnit.KilopascalPerSecond => (_value) * 1e3d,
- PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute => (_value * (4.4482216152605 / 0.00064516) / 60) * 1e3d,
- PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond => (_value * 4.4482216152605 / 0.00064516) * 1e3d,
- PressureChangeRateUnit.MegapascalPerMinute => (_value / 60) * 1e6d,
- PressureChangeRateUnit.MegapascalPerSecond => (_value) * 1e6d,
- PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute => (_value * (4.4482216152605 / 0.00064516) / 60) * 1e6d,
- PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond => (_value * 4.4482216152605 / 0.00064516) * 1e6d,
- PressureChangeRateUnit.MillibarPerMinute => (_value * 1e5 / 60) * 1e-3d,
- PressureChangeRateUnit.MillibarPerSecond => (_value * 1e5) * 1e-3d,
- PressureChangeRateUnit.MillimeterOfMercuryPerSecond => _value * 133.322387415,
- PressureChangeRateUnit.PascalPerMinute => _value / 60,
- PressureChangeRateUnit.PascalPerSecond => _value,
- PressureChangeRateUnit.PoundForcePerSquareInchPerMinute => _value * (4.4482216152605 / 0.00064516) / 60,
- PressureChangeRateUnit.PoundForcePerSquareInchPerSecond => _value * 4.4482216152605 / 0.00064516,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(PressureChangeRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- PressureChangeRateUnit.AtmospherePerSecond => baseUnitValue / (1.01325 * 1e5),
- PressureChangeRateUnit.BarPerMinute => baseUnitValue / 1e5 * 60,
- PressureChangeRateUnit.BarPerSecond => baseUnitValue / 1e5,
- PressureChangeRateUnit.KilopascalPerMinute => (baseUnitValue * 60) / 1e3d,
- PressureChangeRateUnit.KilopascalPerSecond => (baseUnitValue) / 1e3d,
- PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute => (baseUnitValue * 60 / (4.4482216152605 / 0.00064516)) / 1e3d,
- PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond => (baseUnitValue * 0.00064516 / 4.4482216152605) / 1e3d,
- PressureChangeRateUnit.MegapascalPerMinute => (baseUnitValue * 60) / 1e6d,
- PressureChangeRateUnit.MegapascalPerSecond => (baseUnitValue) / 1e6d,
- PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute => (baseUnitValue * 60 / (4.4482216152605 / 0.00064516)) / 1e6d,
- PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond => (baseUnitValue * 0.00064516 / 4.4482216152605) / 1e6d,
- PressureChangeRateUnit.MillibarPerMinute => (baseUnitValue / 1e5 * 60) / 1e-3d,
- PressureChangeRateUnit.MillibarPerSecond => (baseUnitValue / 1e5) / 1e-3d,
- PressureChangeRateUnit.MillimeterOfMercuryPerSecond => baseUnitValue / 133.322387415,
- PressureChangeRateUnit.PascalPerMinute => baseUnitValue * 60,
- PressureChangeRateUnit.PascalPerSecond => baseUnitValue,
- PressureChangeRateUnit.PoundForcePerSquareInchPerMinute => baseUnitValue * 60 / (4.4482216152605 / 0.00064516),
- PressureChangeRateUnit.PoundForcePerSquareInchPerSecond => baseUnitValue * 0.00064516 / 4.4482216152605,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(PressureChangeRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this PressureChangeRate to another PressureChangeRate with the unit representation .
+ ///
+ /// A PressureChangeRate with the specified unit.
+ public PressureChangeRate ToUnit(PressureChangeRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new PressureChangeRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ PressureChangeRateUnit.AtmospherePerSecond => _value * 1.01325 * 1e5,
+ PressureChangeRateUnit.BarPerMinute => _value * 1e5 / 60,
+ PressureChangeRateUnit.BarPerSecond => _value * 1e5,
+ PressureChangeRateUnit.KilopascalPerMinute => (_value / 60) * 1e3d,
+ PressureChangeRateUnit.KilopascalPerSecond => (_value) * 1e3d,
+ PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute => (_value * (4.4482216152605 / 0.00064516) / 60) * 1e3d,
+ PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond => (_value * 4.4482216152605 / 0.00064516) * 1e3d,
+ PressureChangeRateUnit.MegapascalPerMinute => (_value / 60) * 1e6d,
+ PressureChangeRateUnit.MegapascalPerSecond => (_value) * 1e6d,
+ PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute => (_value * (4.4482216152605 / 0.00064516) / 60) * 1e6d,
+ PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond => (_value * 4.4482216152605 / 0.00064516) * 1e6d,
+ PressureChangeRateUnit.MillibarPerMinute => (_value * 1e5 / 60) * 1e-3d,
+ PressureChangeRateUnit.MillibarPerSecond => (_value * 1e5) * 1e-3d,
+ PressureChangeRateUnit.MillimeterOfMercuryPerSecond => _value * 133.322387415,
+ PressureChangeRateUnit.PascalPerMinute => _value / 60,
+ PressureChangeRateUnit.PascalPerSecond => _value,
+ PressureChangeRateUnit.PoundForcePerSquareInchPerMinute => _value * (4.4482216152605 / 0.00064516) / 60,
+ PressureChangeRateUnit.PoundForcePerSquareInchPerSecond => _value * 4.4482216152605 / 0.00064516,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(PressureChangeRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ PressureChangeRateUnit.AtmospherePerSecond => baseUnitValue / (1.01325 * 1e5),
+ PressureChangeRateUnit.BarPerMinute => baseUnitValue / 1e5 * 60,
+ PressureChangeRateUnit.BarPerSecond => baseUnitValue / 1e5,
+ PressureChangeRateUnit.KilopascalPerMinute => (baseUnitValue * 60) / 1e3d,
+ PressureChangeRateUnit.KilopascalPerSecond => (baseUnitValue) / 1e3d,
+ PressureChangeRateUnit.KilopoundForcePerSquareInchPerMinute => (baseUnitValue * 60 / (4.4482216152605 / 0.00064516)) / 1e3d,
+ PressureChangeRateUnit.KilopoundForcePerSquareInchPerSecond => (baseUnitValue * 0.00064516 / 4.4482216152605) / 1e3d,
+ PressureChangeRateUnit.MegapascalPerMinute => (baseUnitValue * 60) / 1e6d,
+ PressureChangeRateUnit.MegapascalPerSecond => (baseUnitValue) / 1e6d,
+ PressureChangeRateUnit.MegapoundForcePerSquareInchPerMinute => (baseUnitValue * 60 / (4.4482216152605 / 0.00064516)) / 1e6d,
+ PressureChangeRateUnit.MegapoundForcePerSquareInchPerSecond => (baseUnitValue * 0.00064516 / 4.4482216152605) / 1e6d,
+ PressureChangeRateUnit.MillibarPerMinute => (baseUnitValue / 1e5 * 60) / 1e-3d,
+ PressureChangeRateUnit.MillibarPerSecond => (baseUnitValue / 1e5) / 1e-3d,
+ PressureChangeRateUnit.MillimeterOfMercuryPerSecond => baseUnitValue / 133.322387415,
+ PressureChangeRateUnit.PascalPerMinute => baseUnitValue * 60,
+ PressureChangeRateUnit.PascalPerSecond => baseUnitValue,
+ PressureChangeRateUnit.PoundForcePerSquareInchPerMinute => baseUnitValue * 60 / (4.4482216152605 / 0.00064516),
+ PressureChangeRateUnit.PoundForcePerSquareInchPerSecond => baseUnitValue * 0.00064516 / 4.4482216152605,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs
index 57ea2e0869..f538ed08c7 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDose.g.cs
@@ -155,63 +155,63 @@ public static RadiationEquivalentDose From(double value, RadiationEquivalentDose
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RadiationEquivalentDoseUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RadiationEquivalentDose to another RadiationEquivalentDose with the unit representation .
- ///
- /// A RadiationEquivalentDose with the specified unit.
- public RadiationEquivalentDose ToUnit(RadiationEquivalentDoseUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RadiationEquivalentDose(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RadiationEquivalentDoseUnit.Microsievert => (_value) * 1e-6d,
- RadiationEquivalentDoseUnit.MilliroentgenEquivalentMan => (_value / 100) * 1e-3d,
- RadiationEquivalentDoseUnit.Millisievert => (_value) * 1e-3d,
- RadiationEquivalentDoseUnit.Nanosievert => (_value) * 1e-9d,
- RadiationEquivalentDoseUnit.RoentgenEquivalentMan => _value / 100,
- RadiationEquivalentDoseUnit.Sievert => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RadiationEquivalentDoseUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RadiationEquivalentDoseUnit.Microsievert => (baseUnitValue) / 1e-6d,
- RadiationEquivalentDoseUnit.MilliroentgenEquivalentMan => (baseUnitValue * 100) / 1e-3d,
- RadiationEquivalentDoseUnit.Millisievert => (baseUnitValue) / 1e-3d,
- RadiationEquivalentDoseUnit.Nanosievert => (baseUnitValue) / 1e-9d,
- RadiationEquivalentDoseUnit.RoentgenEquivalentMan => baseUnitValue * 100,
- RadiationEquivalentDoseUnit.Sievert => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RadiationEquivalentDoseUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RadiationEquivalentDose to another RadiationEquivalentDose with the unit representation .
+ ///
+ /// A RadiationEquivalentDose with the specified unit.
+ public RadiationEquivalentDose ToUnit(RadiationEquivalentDoseUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RadiationEquivalentDose(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RadiationEquivalentDoseUnit.Microsievert => (_value) * 1e-6d,
+ RadiationEquivalentDoseUnit.MilliroentgenEquivalentMan => (_value / 100) * 1e-3d,
+ RadiationEquivalentDoseUnit.Millisievert => (_value) * 1e-3d,
+ RadiationEquivalentDoseUnit.Nanosievert => (_value) * 1e-9d,
+ RadiationEquivalentDoseUnit.RoentgenEquivalentMan => _value / 100,
+ RadiationEquivalentDoseUnit.Sievert => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RadiationEquivalentDoseUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RadiationEquivalentDoseUnit.Microsievert => (baseUnitValue) / 1e-6d,
+ RadiationEquivalentDoseUnit.MilliroentgenEquivalentMan => (baseUnitValue * 100) / 1e-3d,
+ RadiationEquivalentDoseUnit.Millisievert => (baseUnitValue) / 1e-3d,
+ RadiationEquivalentDoseUnit.Nanosievert => (baseUnitValue) / 1e-9d,
+ RadiationEquivalentDoseUnit.RoentgenEquivalentMan => baseUnitValue * 100,
+ RadiationEquivalentDoseUnit.Sievert => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs
index cfd02e3935..06b78f8437 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationEquivalentDoseRate.g.cs
@@ -195,71 +195,71 @@ public static RadiationEquivalentDoseRate From(double value, RadiationEquivalent
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RadiationEquivalentDoseRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RadiationEquivalentDoseRate to another RadiationEquivalentDoseRate with the unit representation .
- ///
- /// A RadiationEquivalentDoseRate with the specified unit.
- public RadiationEquivalentDoseRate ToUnit(RadiationEquivalentDoseRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RadiationEquivalentDoseRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (_value/3600) * 1e-6d,
- RadiationEquivalentDoseRateUnit.MicrosievertPerSecond => (_value) * 1e-6d,
- RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (_value / 100 / 3600) * 1e-3d,
- RadiationEquivalentDoseRateUnit.MillisievertPerHour => (_value/3600) * 1e-3d,
- RadiationEquivalentDoseRateUnit.MillisievertPerSecond => (_value) * 1e-3d,
- RadiationEquivalentDoseRateUnit.NanosievertPerHour => (_value/3600) * 1e-9d,
- RadiationEquivalentDoseRateUnit.NanosievertPerSecond => (_value) * 1e-9d,
- RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => _value / 100 / 3600,
- RadiationEquivalentDoseRateUnit.SievertPerHour => _value/3600,
- RadiationEquivalentDoseRateUnit.SievertPerSecond => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RadiationEquivalentDoseRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (baseUnitValue*3600) / 1e-6d,
- RadiationEquivalentDoseRateUnit.MicrosievertPerSecond => (baseUnitValue) / 1e-6d,
- RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (baseUnitValue * 100 * 3600) / 1e-3d,
- RadiationEquivalentDoseRateUnit.MillisievertPerHour => (baseUnitValue*3600) / 1e-3d,
- RadiationEquivalentDoseRateUnit.MillisievertPerSecond => (baseUnitValue) / 1e-3d,
- RadiationEquivalentDoseRateUnit.NanosievertPerHour => (baseUnitValue*3600) / 1e-9d,
- RadiationEquivalentDoseRateUnit.NanosievertPerSecond => (baseUnitValue) / 1e-9d,
- RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => baseUnitValue * 100 * 3600,
- RadiationEquivalentDoseRateUnit.SievertPerHour => baseUnitValue*3600,
- RadiationEquivalentDoseRateUnit.SievertPerSecond => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RadiationEquivalentDoseRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RadiationEquivalentDoseRate to another RadiationEquivalentDoseRate with the unit representation .
+ ///
+ /// A RadiationEquivalentDoseRate with the specified unit.
+ public RadiationEquivalentDoseRate ToUnit(RadiationEquivalentDoseRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RadiationEquivalentDoseRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (_value/3600) * 1e-6d,
+ RadiationEquivalentDoseRateUnit.MicrosievertPerSecond => (_value) * 1e-6d,
+ RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (_value / 100 / 3600) * 1e-3d,
+ RadiationEquivalentDoseRateUnit.MillisievertPerHour => (_value/3600) * 1e-3d,
+ RadiationEquivalentDoseRateUnit.MillisievertPerSecond => (_value) * 1e-3d,
+ RadiationEquivalentDoseRateUnit.NanosievertPerHour => (_value/3600) * 1e-9d,
+ RadiationEquivalentDoseRateUnit.NanosievertPerSecond => (_value) * 1e-9d,
+ RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => _value / 100 / 3600,
+ RadiationEquivalentDoseRateUnit.SievertPerHour => _value/3600,
+ RadiationEquivalentDoseRateUnit.SievertPerSecond => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RadiationEquivalentDoseRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RadiationEquivalentDoseRateUnit.MicrosievertPerHour => (baseUnitValue*3600) / 1e-6d,
+ RadiationEquivalentDoseRateUnit.MicrosievertPerSecond => (baseUnitValue) / 1e-6d,
+ RadiationEquivalentDoseRateUnit.MilliroentgenEquivalentManPerHour => (baseUnitValue * 100 * 3600) / 1e-3d,
+ RadiationEquivalentDoseRateUnit.MillisievertPerHour => (baseUnitValue*3600) / 1e-3d,
+ RadiationEquivalentDoseRateUnit.MillisievertPerSecond => (baseUnitValue) / 1e-3d,
+ RadiationEquivalentDoseRateUnit.NanosievertPerHour => (baseUnitValue*3600) / 1e-9d,
+ RadiationEquivalentDoseRateUnit.NanosievertPerSecond => (baseUnitValue) / 1e-9d,
+ RadiationEquivalentDoseRateUnit.RoentgenEquivalentManPerHour => baseUnitValue * 100 * 3600,
+ RadiationEquivalentDoseRateUnit.SievertPerHour => baseUnitValue*3600,
+ RadiationEquivalentDoseRateUnit.SievertPerSecond => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationExposure.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationExposure.g.cs
index eb3b34d723..808707d533 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationExposure.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RadiationExposure.g.cs
@@ -175,67 +175,67 @@ public static RadiationExposure From(double value, RadiationExposureUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RadiationExposureUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RadiationExposure to another RadiationExposure with the unit representation .
- ///
- /// A RadiationExposure with the specified unit.
- public RadiationExposure ToUnit(RadiationExposureUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RadiationExposure(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RadiationExposureUnit.CoulombPerKilogram => _value,
- RadiationExposureUnit.MicrocoulombPerKilogram => (_value) * 1e-6d,
- RadiationExposureUnit.Microroentgen => (_value * 2.58e-4) * 1e-6d,
- RadiationExposureUnit.MillicoulombPerKilogram => (_value) * 1e-3d,
- RadiationExposureUnit.Milliroentgen => (_value * 2.58e-4) * 1e-3d,
- RadiationExposureUnit.NanocoulombPerKilogram => (_value) * 1e-9d,
- RadiationExposureUnit.PicocoulombPerKilogram => (_value) * 1e-12d,
- RadiationExposureUnit.Roentgen => _value * 2.58e-4,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RadiationExposureUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RadiationExposureUnit.CoulombPerKilogram => baseUnitValue,
- RadiationExposureUnit.MicrocoulombPerKilogram => (baseUnitValue) / 1e-6d,
- RadiationExposureUnit.Microroentgen => (baseUnitValue / 2.58e-4) / 1e-6d,
- RadiationExposureUnit.MillicoulombPerKilogram => (baseUnitValue) / 1e-3d,
- RadiationExposureUnit.Milliroentgen => (baseUnitValue / 2.58e-4) / 1e-3d,
- RadiationExposureUnit.NanocoulombPerKilogram => (baseUnitValue) / 1e-9d,
- RadiationExposureUnit.PicocoulombPerKilogram => (baseUnitValue) / 1e-12d,
- RadiationExposureUnit.Roentgen => baseUnitValue / 2.58e-4,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RadiationExposureUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RadiationExposure to another RadiationExposure with the unit representation .
+ ///
+ /// A RadiationExposure with the specified unit.
+ public RadiationExposure ToUnit(RadiationExposureUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RadiationExposure(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RadiationExposureUnit.CoulombPerKilogram => _value,
+ RadiationExposureUnit.MicrocoulombPerKilogram => (_value) * 1e-6d,
+ RadiationExposureUnit.Microroentgen => (_value * 2.58e-4) * 1e-6d,
+ RadiationExposureUnit.MillicoulombPerKilogram => (_value) * 1e-3d,
+ RadiationExposureUnit.Milliroentgen => (_value * 2.58e-4) * 1e-3d,
+ RadiationExposureUnit.NanocoulombPerKilogram => (_value) * 1e-9d,
+ RadiationExposureUnit.PicocoulombPerKilogram => (_value) * 1e-12d,
+ RadiationExposureUnit.Roentgen => _value * 2.58e-4,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RadiationExposureUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RadiationExposureUnit.CoulombPerKilogram => baseUnitValue,
+ RadiationExposureUnit.MicrocoulombPerKilogram => (baseUnitValue) / 1e-6d,
+ RadiationExposureUnit.Microroentgen => (baseUnitValue / 2.58e-4) / 1e-6d,
+ RadiationExposureUnit.MillicoulombPerKilogram => (baseUnitValue) / 1e-3d,
+ RadiationExposureUnit.Milliroentgen => (baseUnitValue / 2.58e-4) / 1e-3d,
+ RadiationExposureUnit.NanocoulombPerKilogram => (baseUnitValue) / 1e-9d,
+ RadiationExposureUnit.PicocoulombPerKilogram => (baseUnitValue) / 1e-12d,
+ RadiationExposureUnit.Roentgen => baseUnitValue / 2.58e-4,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Radioactivity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Radioactivity.g.cs
index a5b0422773..7611164537 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Radioactivity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Radioactivity.g.cs
@@ -385,109 +385,109 @@ public static Radioactivity From(double value, RadioactivityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RadioactivityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Radioactivity to another Radioactivity with the unit representation .
- ///
- /// A Radioactivity with the specified unit.
- public Radioactivity ToUnit(RadioactivityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Radioactivity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RadioactivityUnit.Becquerel => _value,
- RadioactivityUnit.Curie => _value * 3.7e10,
- RadioactivityUnit.Exabecquerel => (_value) * 1e18d,
- RadioactivityUnit.Gigabecquerel => (_value) * 1e9d,
- RadioactivityUnit.Gigacurie => (_value * 3.7e10) * 1e9d,
- RadioactivityUnit.Gigarutherford => (_value * 1e6) * 1e9d,
- RadioactivityUnit.Kilobecquerel => (_value) * 1e3d,
- RadioactivityUnit.Kilocurie => (_value * 3.7e10) * 1e3d,
- RadioactivityUnit.Kilorutherford => (_value * 1e6) * 1e3d,
- RadioactivityUnit.Megabecquerel => (_value) * 1e6d,
- RadioactivityUnit.Megacurie => (_value * 3.7e10) * 1e6d,
- RadioactivityUnit.Megarutherford => (_value * 1e6) * 1e6d,
- RadioactivityUnit.Microbecquerel => (_value) * 1e-6d,
- RadioactivityUnit.Microcurie => (_value * 3.7e10) * 1e-6d,
- RadioactivityUnit.Microrutherford => (_value * 1e6) * 1e-6d,
- RadioactivityUnit.Millibecquerel => (_value) * 1e-3d,
- RadioactivityUnit.Millicurie => (_value * 3.7e10) * 1e-3d,
- RadioactivityUnit.Millirutherford => (_value * 1e6) * 1e-3d,
- RadioactivityUnit.Nanobecquerel => (_value) * 1e-9d,
- RadioactivityUnit.Nanocurie => (_value * 3.7e10) * 1e-9d,
- RadioactivityUnit.Nanorutherford => (_value * 1e6) * 1e-9d,
- RadioactivityUnit.Petabecquerel => (_value) * 1e15d,
- RadioactivityUnit.Picobecquerel => (_value) * 1e-12d,
- RadioactivityUnit.Picocurie => (_value * 3.7e10) * 1e-12d,
- RadioactivityUnit.Picorutherford => (_value * 1e6) * 1e-12d,
- RadioactivityUnit.Rutherford => _value * 1e6,
- RadioactivityUnit.Terabecquerel => (_value) * 1e12d,
- RadioactivityUnit.Teracurie => (_value * 3.7e10) * 1e12d,
- RadioactivityUnit.Terarutherford => (_value * 1e6) * 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RadioactivityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RadioactivityUnit.Becquerel => baseUnitValue,
- RadioactivityUnit.Curie => baseUnitValue / 3.7e10,
- RadioactivityUnit.Exabecquerel => (baseUnitValue) / 1e18d,
- RadioactivityUnit.Gigabecquerel => (baseUnitValue) / 1e9d,
- RadioactivityUnit.Gigacurie => (baseUnitValue / 3.7e10) / 1e9d,
- RadioactivityUnit.Gigarutherford => (baseUnitValue / 1e6) / 1e9d,
- RadioactivityUnit.Kilobecquerel => (baseUnitValue) / 1e3d,
- RadioactivityUnit.Kilocurie => (baseUnitValue / 3.7e10) / 1e3d,
- RadioactivityUnit.Kilorutherford => (baseUnitValue / 1e6) / 1e3d,
- RadioactivityUnit.Megabecquerel => (baseUnitValue) / 1e6d,
- RadioactivityUnit.Megacurie => (baseUnitValue / 3.7e10) / 1e6d,
- RadioactivityUnit.Megarutherford => (baseUnitValue / 1e6) / 1e6d,
- RadioactivityUnit.Microbecquerel => (baseUnitValue) / 1e-6d,
- RadioactivityUnit.Microcurie => (baseUnitValue / 3.7e10) / 1e-6d,
- RadioactivityUnit.Microrutherford => (baseUnitValue / 1e6) / 1e-6d,
- RadioactivityUnit.Millibecquerel => (baseUnitValue) / 1e-3d,
- RadioactivityUnit.Millicurie => (baseUnitValue / 3.7e10) / 1e-3d,
- RadioactivityUnit.Millirutherford => (baseUnitValue / 1e6) / 1e-3d,
- RadioactivityUnit.Nanobecquerel => (baseUnitValue) / 1e-9d,
- RadioactivityUnit.Nanocurie => (baseUnitValue / 3.7e10) / 1e-9d,
- RadioactivityUnit.Nanorutherford => (baseUnitValue / 1e6) / 1e-9d,
- RadioactivityUnit.Petabecquerel => (baseUnitValue) / 1e15d,
- RadioactivityUnit.Picobecquerel => (baseUnitValue) / 1e-12d,
- RadioactivityUnit.Picocurie => (baseUnitValue / 3.7e10) / 1e-12d,
- RadioactivityUnit.Picorutherford => (baseUnitValue / 1e6) / 1e-12d,
- RadioactivityUnit.Rutherford => baseUnitValue / 1e6,
- RadioactivityUnit.Terabecquerel => (baseUnitValue) / 1e12d,
- RadioactivityUnit.Teracurie => (baseUnitValue / 3.7e10) / 1e12d,
- RadioactivityUnit.Terarutherford => (baseUnitValue / 1e6) / 1e12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RadioactivityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Radioactivity to another Radioactivity with the unit representation .
+ ///
+ /// A Radioactivity with the specified unit.
+ public Radioactivity ToUnit(RadioactivityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Radioactivity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RadioactivityUnit.Becquerel => _value,
+ RadioactivityUnit.Curie => _value * 3.7e10,
+ RadioactivityUnit.Exabecquerel => (_value) * 1e18d,
+ RadioactivityUnit.Gigabecquerel => (_value) * 1e9d,
+ RadioactivityUnit.Gigacurie => (_value * 3.7e10) * 1e9d,
+ RadioactivityUnit.Gigarutherford => (_value * 1e6) * 1e9d,
+ RadioactivityUnit.Kilobecquerel => (_value) * 1e3d,
+ RadioactivityUnit.Kilocurie => (_value * 3.7e10) * 1e3d,
+ RadioactivityUnit.Kilorutherford => (_value * 1e6) * 1e3d,
+ RadioactivityUnit.Megabecquerel => (_value) * 1e6d,
+ RadioactivityUnit.Megacurie => (_value * 3.7e10) * 1e6d,
+ RadioactivityUnit.Megarutherford => (_value * 1e6) * 1e6d,
+ RadioactivityUnit.Microbecquerel => (_value) * 1e-6d,
+ RadioactivityUnit.Microcurie => (_value * 3.7e10) * 1e-6d,
+ RadioactivityUnit.Microrutherford => (_value * 1e6) * 1e-6d,
+ RadioactivityUnit.Millibecquerel => (_value) * 1e-3d,
+ RadioactivityUnit.Millicurie => (_value * 3.7e10) * 1e-3d,
+ RadioactivityUnit.Millirutherford => (_value * 1e6) * 1e-3d,
+ RadioactivityUnit.Nanobecquerel => (_value) * 1e-9d,
+ RadioactivityUnit.Nanocurie => (_value * 3.7e10) * 1e-9d,
+ RadioactivityUnit.Nanorutherford => (_value * 1e6) * 1e-9d,
+ RadioactivityUnit.Petabecquerel => (_value) * 1e15d,
+ RadioactivityUnit.Picobecquerel => (_value) * 1e-12d,
+ RadioactivityUnit.Picocurie => (_value * 3.7e10) * 1e-12d,
+ RadioactivityUnit.Picorutherford => (_value * 1e6) * 1e-12d,
+ RadioactivityUnit.Rutherford => _value * 1e6,
+ RadioactivityUnit.Terabecquerel => (_value) * 1e12d,
+ RadioactivityUnit.Teracurie => (_value * 3.7e10) * 1e12d,
+ RadioactivityUnit.Terarutherford => (_value * 1e6) * 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RadioactivityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RadioactivityUnit.Becquerel => baseUnitValue,
+ RadioactivityUnit.Curie => baseUnitValue / 3.7e10,
+ RadioactivityUnit.Exabecquerel => (baseUnitValue) / 1e18d,
+ RadioactivityUnit.Gigabecquerel => (baseUnitValue) / 1e9d,
+ RadioactivityUnit.Gigacurie => (baseUnitValue / 3.7e10) / 1e9d,
+ RadioactivityUnit.Gigarutherford => (baseUnitValue / 1e6) / 1e9d,
+ RadioactivityUnit.Kilobecquerel => (baseUnitValue) / 1e3d,
+ RadioactivityUnit.Kilocurie => (baseUnitValue / 3.7e10) / 1e3d,
+ RadioactivityUnit.Kilorutherford => (baseUnitValue / 1e6) / 1e3d,
+ RadioactivityUnit.Megabecquerel => (baseUnitValue) / 1e6d,
+ RadioactivityUnit.Megacurie => (baseUnitValue / 3.7e10) / 1e6d,
+ RadioactivityUnit.Megarutherford => (baseUnitValue / 1e6) / 1e6d,
+ RadioactivityUnit.Microbecquerel => (baseUnitValue) / 1e-6d,
+ RadioactivityUnit.Microcurie => (baseUnitValue / 3.7e10) / 1e-6d,
+ RadioactivityUnit.Microrutherford => (baseUnitValue / 1e6) / 1e-6d,
+ RadioactivityUnit.Millibecquerel => (baseUnitValue) / 1e-3d,
+ RadioactivityUnit.Millicurie => (baseUnitValue / 3.7e10) / 1e-3d,
+ RadioactivityUnit.Millirutherford => (baseUnitValue / 1e6) / 1e-3d,
+ RadioactivityUnit.Nanobecquerel => (baseUnitValue) / 1e-9d,
+ RadioactivityUnit.Nanocurie => (baseUnitValue / 3.7e10) / 1e-9d,
+ RadioactivityUnit.Nanorutherford => (baseUnitValue / 1e6) / 1e-9d,
+ RadioactivityUnit.Petabecquerel => (baseUnitValue) / 1e15d,
+ RadioactivityUnit.Picobecquerel => (baseUnitValue) / 1e-12d,
+ RadioactivityUnit.Picocurie => (baseUnitValue / 3.7e10) / 1e-12d,
+ RadioactivityUnit.Picorutherford => (baseUnitValue / 1e6) / 1e-12d,
+ RadioactivityUnit.Rutherford => baseUnitValue / 1e6,
+ RadioactivityUnit.Terabecquerel => (baseUnitValue) / 1e12d,
+ RadioactivityUnit.Teracurie => (baseUnitValue / 3.7e10) / 1e12d,
+ RadioactivityUnit.Terarutherford => (baseUnitValue / 1e6) / 1e12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Ratio.g.cs
index 851469f361..0698d06015 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Ratio.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Ratio.g.cs
@@ -155,63 +155,63 @@ public static Ratio From(double value, RatioUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RatioUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Ratio to another Ratio with the unit representation .
- ///
- /// A Ratio with the specified unit.
- public Ratio ToUnit(RatioUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Ratio(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RatioUnit.DecimalFraction => _value,
- RatioUnit.PartPerBillion => _value / 1e9,
- RatioUnit.PartPerMillion => _value / 1e6,
- RatioUnit.PartPerThousand => _value / 1e3,
- RatioUnit.PartPerTrillion => _value / 1e12,
- RatioUnit.Percent => _value / 1e2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RatioUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RatioUnit.DecimalFraction => baseUnitValue,
- RatioUnit.PartPerBillion => baseUnitValue * 1e9,
- RatioUnit.PartPerMillion => baseUnitValue * 1e6,
- RatioUnit.PartPerThousand => baseUnitValue * 1e3,
- RatioUnit.PartPerTrillion => baseUnitValue * 1e12,
- RatioUnit.Percent => baseUnitValue * 1e2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RatioUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Ratio to another Ratio with the unit representation .
+ ///
+ /// A Ratio with the specified unit.
+ public Ratio ToUnit(RatioUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Ratio(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RatioUnit.DecimalFraction => _value,
+ RatioUnit.PartPerBillion => _value / 1e9,
+ RatioUnit.PartPerMillion => _value / 1e6,
+ RatioUnit.PartPerThousand => _value / 1e3,
+ RatioUnit.PartPerTrillion => _value / 1e12,
+ RatioUnit.Percent => _value / 1e2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RatioUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RatioUnit.DecimalFraction => baseUnitValue,
+ RatioUnit.PartPerBillion => baseUnitValue * 1e9,
+ RatioUnit.PartPerMillion => baseUnitValue * 1e6,
+ RatioUnit.PartPerThousand => baseUnitValue * 1e3,
+ RatioUnit.PartPerTrillion => baseUnitValue * 1e12,
+ RatioUnit.Percent => baseUnitValue * 1e2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RatioChangeRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RatioChangeRate.g.cs
index fbf544789d..09e911b7b5 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RatioChangeRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RatioChangeRate.g.cs
@@ -115,55 +115,55 @@ public static RatioChangeRate From(double value, RatioChangeRateUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RatioChangeRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RatioChangeRate to another RatioChangeRate with the unit representation .
- ///
- /// A RatioChangeRate with the specified unit.
- public RatioChangeRate ToUnit(RatioChangeRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RatioChangeRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RatioChangeRateUnit.DecimalFractionPerSecond => _value,
- RatioChangeRateUnit.PercentPerSecond => _value / 1e2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RatioChangeRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RatioChangeRateUnit.DecimalFractionPerSecond => baseUnitValue,
- RatioChangeRateUnit.PercentPerSecond => baseUnitValue * 1e2,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RatioChangeRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RatioChangeRate to another RatioChangeRate with the unit representation .
+ ///
+ /// A RatioChangeRate with the specified unit.
+ public RatioChangeRate ToUnit(RatioChangeRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RatioChangeRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RatioChangeRateUnit.DecimalFractionPerSecond => _value,
+ RatioChangeRateUnit.PercentPerSecond => _value / 1e2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RatioChangeRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RatioChangeRateUnit.DecimalFractionPerSecond => baseUnitValue,
+ RatioChangeRateUnit.PercentPerSecond => baseUnitValue * 1e2,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalArea.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalArea.g.cs
index 3904a09425..399875e08d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalArea.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalArea.g.cs
@@ -208,73 +208,73 @@ public static ReciprocalArea From(double value, ReciprocalAreaUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ReciprocalAreaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ReciprocalArea to another ReciprocalArea with the unit representation .
- ///
- /// A ReciprocalArea with the specified unit.
- public ReciprocalArea ToUnit(ReciprocalAreaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ReciprocalArea(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ReciprocalAreaUnit.InverseSquareCentimeter => _value / 1e-4,
- ReciprocalAreaUnit.InverseSquareDecimeter => _value / 1e-2,
- ReciprocalAreaUnit.InverseSquareFoot => _value / 9.290304e-2,
- ReciprocalAreaUnit.InverseSquareInch => _value / 0.00064516,
- ReciprocalAreaUnit.InverseSquareKilometer => _value / 1e6,
- ReciprocalAreaUnit.InverseSquareMeter => _value,
- ReciprocalAreaUnit.InverseSquareMicrometer => _value / 1e-12,
- ReciprocalAreaUnit.InverseSquareMile => _value / (1609.344 * 1609.344),
- ReciprocalAreaUnit.InverseSquareMillimeter => _value / 1e-6,
- ReciprocalAreaUnit.InverseSquareYard => _value / (0.9144 * 0.9144),
- ReciprocalAreaUnit.InverseUsSurveySquareFoot => _value / (1200.0 / 3937.0) / (1200.0 / 3937.0),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ReciprocalAreaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ReciprocalAreaUnit.InverseSquareCentimeter => baseUnitValue * 1e-4,
- ReciprocalAreaUnit.InverseSquareDecimeter => baseUnitValue * 1e-2,
- ReciprocalAreaUnit.InverseSquareFoot => baseUnitValue * 9.290304e-2,
- ReciprocalAreaUnit.InverseSquareInch => baseUnitValue * 0.00064516,
- ReciprocalAreaUnit.InverseSquareKilometer => baseUnitValue * 1e6,
- ReciprocalAreaUnit.InverseSquareMeter => baseUnitValue,
- ReciprocalAreaUnit.InverseSquareMicrometer => baseUnitValue * 1e-12,
- ReciprocalAreaUnit.InverseSquareMile => baseUnitValue * (1609.344 * 1609.344),
- ReciprocalAreaUnit.InverseSquareMillimeter => baseUnitValue * 1e-6,
- ReciprocalAreaUnit.InverseSquareYard => baseUnitValue * (0.9144 * 0.9144),
- ReciprocalAreaUnit.InverseUsSurveySquareFoot => baseUnitValue * (1200.0 / 3937.0) * (1200.0 / 3937.0),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ReciprocalAreaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ReciprocalArea to another ReciprocalArea with the unit representation .
+ ///
+ /// A ReciprocalArea with the specified unit.
+ public ReciprocalArea ToUnit(ReciprocalAreaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ReciprocalArea(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ReciprocalAreaUnit.InverseSquareCentimeter => _value / 1e-4,
+ ReciprocalAreaUnit.InverseSquareDecimeter => _value / 1e-2,
+ ReciprocalAreaUnit.InverseSquareFoot => _value / 9.290304e-2,
+ ReciprocalAreaUnit.InverseSquareInch => _value / 0.00064516,
+ ReciprocalAreaUnit.InverseSquareKilometer => _value / 1e6,
+ ReciprocalAreaUnit.InverseSquareMeter => _value,
+ ReciprocalAreaUnit.InverseSquareMicrometer => _value / 1e-12,
+ ReciprocalAreaUnit.InverseSquareMile => _value / (1609.344 * 1609.344),
+ ReciprocalAreaUnit.InverseSquareMillimeter => _value / 1e-6,
+ ReciprocalAreaUnit.InverseSquareYard => _value / (0.9144 * 0.9144),
+ ReciprocalAreaUnit.InverseUsSurveySquareFoot => _value / (1200.0 / 3937.0) / (1200.0 / 3937.0),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ReciprocalAreaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ReciprocalAreaUnit.InverseSquareCentimeter => baseUnitValue * 1e-4,
+ ReciprocalAreaUnit.InverseSquareDecimeter => baseUnitValue * 1e-2,
+ ReciprocalAreaUnit.InverseSquareFoot => baseUnitValue * 9.290304e-2,
+ ReciprocalAreaUnit.InverseSquareInch => baseUnitValue * 0.00064516,
+ ReciprocalAreaUnit.InverseSquareKilometer => baseUnitValue * 1e6,
+ ReciprocalAreaUnit.InverseSquareMeter => baseUnitValue,
+ ReciprocalAreaUnit.InverseSquareMicrometer => baseUnitValue * 1e-12,
+ ReciprocalAreaUnit.InverseSquareMile => baseUnitValue * (1609.344 * 1609.344),
+ ReciprocalAreaUnit.InverseSquareMillimeter => baseUnitValue * 1e-6,
+ ReciprocalAreaUnit.InverseSquareYard => baseUnitValue * (0.9144 * 0.9144),
+ ReciprocalAreaUnit.InverseUsSurveySquareFoot => baseUnitValue * (1200.0 / 3937.0) * (1200.0 / 3937.0),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalLength.g.cs
index 4663e72183..735803f65c 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalLength.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ReciprocalLength.g.cs
@@ -198,71 +198,71 @@ public static ReciprocalLength From(double value, ReciprocalLengthUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ReciprocalLengthUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ReciprocalLength to another ReciprocalLength with the unit representation .
- ///
- /// A ReciprocalLength with the specified unit.
- public ReciprocalLength ToUnit(ReciprocalLengthUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ReciprocalLength(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ReciprocalLengthUnit.InverseCentimeter => _value * 1e2,
- ReciprocalLengthUnit.InverseFoot => _value / 0.3048,
- ReciprocalLengthUnit.InverseInch => _value / 2.54e-2,
- ReciprocalLengthUnit.InverseMeter => _value,
- ReciprocalLengthUnit.InverseMicroinch => _value / 2.54e-8,
- ReciprocalLengthUnit.InverseMil => _value / 2.54e-5,
- ReciprocalLengthUnit.InverseMile => _value / 1609.344,
- ReciprocalLengthUnit.InverseMillimeter => _value * 1e3,
- ReciprocalLengthUnit.InverseUsSurveyFoot => _value * 3937 / 1200,
- ReciprocalLengthUnit.InverseYard => _value / 0.9144,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ReciprocalLengthUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ReciprocalLengthUnit.InverseCentimeter => baseUnitValue / 1e2,
- ReciprocalLengthUnit.InverseFoot => baseUnitValue * 0.3048,
- ReciprocalLengthUnit.InverseInch => baseUnitValue * 2.54e-2,
- ReciprocalLengthUnit.InverseMeter => baseUnitValue,
- ReciprocalLengthUnit.InverseMicroinch => baseUnitValue * 2.54e-8,
- ReciprocalLengthUnit.InverseMil => baseUnitValue * 2.54e-5,
- ReciprocalLengthUnit.InverseMile => baseUnitValue * 1609.344,
- ReciprocalLengthUnit.InverseMillimeter => baseUnitValue / 1e3,
- ReciprocalLengthUnit.InverseUsSurveyFoot => baseUnitValue * 1200 / 3937,
- ReciprocalLengthUnit.InverseYard => baseUnitValue * 0.9144,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ReciprocalLengthUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ReciprocalLength to another ReciprocalLength with the unit representation .
+ ///
+ /// A ReciprocalLength with the specified unit.
+ public ReciprocalLength ToUnit(ReciprocalLengthUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ReciprocalLength(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ReciprocalLengthUnit.InverseCentimeter => _value * 1e2,
+ ReciprocalLengthUnit.InverseFoot => _value / 0.3048,
+ ReciprocalLengthUnit.InverseInch => _value / 2.54e-2,
+ ReciprocalLengthUnit.InverseMeter => _value,
+ ReciprocalLengthUnit.InverseMicroinch => _value / 2.54e-8,
+ ReciprocalLengthUnit.InverseMil => _value / 2.54e-5,
+ ReciprocalLengthUnit.InverseMile => _value / 1609.344,
+ ReciprocalLengthUnit.InverseMillimeter => _value * 1e3,
+ ReciprocalLengthUnit.InverseUsSurveyFoot => _value * 3937 / 1200,
+ ReciprocalLengthUnit.InverseYard => _value / 0.9144,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ReciprocalLengthUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ReciprocalLengthUnit.InverseCentimeter => baseUnitValue / 1e2,
+ ReciprocalLengthUnit.InverseFoot => baseUnitValue * 0.3048,
+ ReciprocalLengthUnit.InverseInch => baseUnitValue * 2.54e-2,
+ ReciprocalLengthUnit.InverseMeter => baseUnitValue,
+ ReciprocalLengthUnit.InverseMicroinch => baseUnitValue * 2.54e-8,
+ ReciprocalLengthUnit.InverseMil => baseUnitValue * 2.54e-5,
+ ReciprocalLengthUnit.InverseMile => baseUnitValue * 1609.344,
+ ReciprocalLengthUnit.InverseMillimeter => baseUnitValue / 1e3,
+ ReciprocalLengthUnit.InverseUsSurveyFoot => baseUnitValue * 1200 / 3937,
+ ReciprocalLengthUnit.InverseYard => baseUnitValue * 0.9144,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RelativeHumidity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RelativeHumidity.g.cs
index c3c583d1b3..a5cc52ed5d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RelativeHumidity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RelativeHumidity.g.cs
@@ -105,53 +105,53 @@ public static RelativeHumidity From(double value, RelativeHumidityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RelativeHumidityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RelativeHumidity to another RelativeHumidity with the unit representation .
- ///
- /// A RelativeHumidity with the specified unit.
- public RelativeHumidity ToUnit(RelativeHumidityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RelativeHumidity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RelativeHumidityUnit.Percent => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RelativeHumidityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RelativeHumidityUnit.Percent => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RelativeHumidityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RelativeHumidity to another RelativeHumidity with the unit representation .
+ ///
+ /// A RelativeHumidity with the specified unit.
+ public RelativeHumidity ToUnit(RelativeHumidityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RelativeHumidity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RelativeHumidityUnit.Percent => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RelativeHumidityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RelativeHumidityUnit.Percent => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalAcceleration.g.cs
index 7bdaedb545..87e58ded83 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalAcceleration.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalAcceleration.g.cs
@@ -135,59 +135,59 @@ public static RotationalAcceleration From(double value, RotationalAccelerationUn
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RotationalAccelerationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RotationalAcceleration to another RotationalAcceleration with the unit representation .
- ///
- /// A RotationalAcceleration with the specified unit.
- public RotationalAcceleration ToUnit(RotationalAccelerationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RotationalAcceleration(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RotationalAccelerationUnit.DegreePerSecondSquared => (3.1415926535897931 / 180) * _value,
- RotationalAccelerationUnit.RadianPerSecondSquared => _value,
- RotationalAccelerationUnit.RevolutionPerMinutePerSecond => ((2 * 3.1415926535897931) / 60) * _value,
- RotationalAccelerationUnit.RevolutionPerSecondSquared => (2 * 3.1415926535897931) * _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RotationalAccelerationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RotationalAccelerationUnit.DegreePerSecondSquared => (180 / 3.1415926535897931) * baseUnitValue,
- RotationalAccelerationUnit.RadianPerSecondSquared => baseUnitValue,
- RotationalAccelerationUnit.RevolutionPerMinutePerSecond => (60 / (2 * 3.1415926535897931)) * baseUnitValue,
- RotationalAccelerationUnit.RevolutionPerSecondSquared => (1 / (2 * 3.1415926535897931)) * baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RotationalAccelerationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RotationalAcceleration to another RotationalAcceleration with the unit representation .
+ ///
+ /// A RotationalAcceleration with the specified unit.
+ public RotationalAcceleration ToUnit(RotationalAccelerationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RotationalAcceleration(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RotationalAccelerationUnit.DegreePerSecondSquared => (3.1415926535897931 / 180) * _value,
+ RotationalAccelerationUnit.RadianPerSecondSquared => _value,
+ RotationalAccelerationUnit.RevolutionPerMinutePerSecond => ((2 * 3.1415926535897931) / 60) * _value,
+ RotationalAccelerationUnit.RevolutionPerSecondSquared => (2 * 3.1415926535897931) * _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RotationalAccelerationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RotationalAccelerationUnit.DegreePerSecondSquared => (180 / 3.1415926535897931) * baseUnitValue,
+ RotationalAccelerationUnit.RadianPerSecondSquared => baseUnitValue,
+ RotationalAccelerationUnit.RevolutionPerMinutePerSecond => (60 / (2 * 3.1415926535897931)) * baseUnitValue,
+ RotationalAccelerationUnit.RevolutionPerSecondSquared => (1 / (2 * 3.1415926535897931)) * baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalSpeed.g.cs
index 079d1d6c7d..66d7818e39 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalSpeed.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalSpeed.g.cs
@@ -225,77 +225,77 @@ public static RotationalSpeed From(double value, RotationalSpeedUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RotationalSpeedUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RotationalSpeed to another RotationalSpeed with the unit representation .
- ///
- /// A RotationalSpeed with the specified unit.
- public RotationalSpeed ToUnit(RotationalSpeedUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RotationalSpeed(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RotationalSpeedUnit.CentiradianPerSecond => (_value) * 1e-2d,
- RotationalSpeedUnit.DeciradianPerSecond => (_value) * 1e-1d,
- RotationalSpeedUnit.DegreePerMinute => (3.1415926535897931 / (180 * 60)) * _value,
- RotationalSpeedUnit.DegreePerSecond => (3.1415926535897931 / 180) * _value,
- RotationalSpeedUnit.MicrodegreePerSecond => ((3.1415926535897931 / 180) * _value) * 1e-6d,
- RotationalSpeedUnit.MicroradianPerSecond => (_value) * 1e-6d,
- RotationalSpeedUnit.MillidegreePerSecond => ((3.1415926535897931 / 180) * _value) * 1e-3d,
- RotationalSpeedUnit.MilliradianPerSecond => (_value) * 1e-3d,
- RotationalSpeedUnit.NanodegreePerSecond => ((3.1415926535897931 / 180) * _value) * 1e-9d,
- RotationalSpeedUnit.NanoradianPerSecond => (_value) * 1e-9d,
- RotationalSpeedUnit.RadianPerSecond => _value,
- RotationalSpeedUnit.RevolutionPerMinute => (_value * 2 * 3.1415926535897931) / 60,
- RotationalSpeedUnit.RevolutionPerSecond => _value * 2 * 3.1415926535897931,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RotationalSpeedUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RotationalSpeedUnit.CentiradianPerSecond => (baseUnitValue) / 1e-2d,
- RotationalSpeedUnit.DeciradianPerSecond => (baseUnitValue) / 1e-1d,
- RotationalSpeedUnit.DegreePerMinute => (180 * 60 / 3.1415926535897931) * baseUnitValue,
- RotationalSpeedUnit.DegreePerSecond => (180 / 3.1415926535897931) * baseUnitValue,
- RotationalSpeedUnit.MicrodegreePerSecond => ((180 / 3.1415926535897931) * baseUnitValue) / 1e-6d,
- RotationalSpeedUnit.MicroradianPerSecond => (baseUnitValue) / 1e-6d,
- RotationalSpeedUnit.MillidegreePerSecond => ((180 / 3.1415926535897931) * baseUnitValue) / 1e-3d,
- RotationalSpeedUnit.MilliradianPerSecond => (baseUnitValue) / 1e-3d,
- RotationalSpeedUnit.NanodegreePerSecond => ((180 / 3.1415926535897931) * baseUnitValue) / 1e-9d,
- RotationalSpeedUnit.NanoradianPerSecond => (baseUnitValue) / 1e-9d,
- RotationalSpeedUnit.RadianPerSecond => baseUnitValue,
- RotationalSpeedUnit.RevolutionPerMinute => (baseUnitValue / (2 * 3.1415926535897931)) * 60,
- RotationalSpeedUnit.RevolutionPerSecond => baseUnitValue / (2 * 3.1415926535897931),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RotationalSpeedUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RotationalSpeed to another RotationalSpeed with the unit representation .
+ ///
+ /// A RotationalSpeed with the specified unit.
+ public RotationalSpeed ToUnit(RotationalSpeedUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RotationalSpeed(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RotationalSpeedUnit.CentiradianPerSecond => (_value) * 1e-2d,
+ RotationalSpeedUnit.DeciradianPerSecond => (_value) * 1e-1d,
+ RotationalSpeedUnit.DegreePerMinute => (3.1415926535897931 / (180 * 60)) * _value,
+ RotationalSpeedUnit.DegreePerSecond => (3.1415926535897931 / 180) * _value,
+ RotationalSpeedUnit.MicrodegreePerSecond => ((3.1415926535897931 / 180) * _value) * 1e-6d,
+ RotationalSpeedUnit.MicroradianPerSecond => (_value) * 1e-6d,
+ RotationalSpeedUnit.MillidegreePerSecond => ((3.1415926535897931 / 180) * _value) * 1e-3d,
+ RotationalSpeedUnit.MilliradianPerSecond => (_value) * 1e-3d,
+ RotationalSpeedUnit.NanodegreePerSecond => ((3.1415926535897931 / 180) * _value) * 1e-9d,
+ RotationalSpeedUnit.NanoradianPerSecond => (_value) * 1e-9d,
+ RotationalSpeedUnit.RadianPerSecond => _value,
+ RotationalSpeedUnit.RevolutionPerMinute => (_value * 2 * 3.1415926535897931) / 60,
+ RotationalSpeedUnit.RevolutionPerSecond => _value * 2 * 3.1415926535897931,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RotationalSpeedUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RotationalSpeedUnit.CentiradianPerSecond => (baseUnitValue) / 1e-2d,
+ RotationalSpeedUnit.DeciradianPerSecond => (baseUnitValue) / 1e-1d,
+ RotationalSpeedUnit.DegreePerMinute => (180 * 60 / 3.1415926535897931) * baseUnitValue,
+ RotationalSpeedUnit.DegreePerSecond => (180 / 3.1415926535897931) * baseUnitValue,
+ RotationalSpeedUnit.MicrodegreePerSecond => ((180 / 3.1415926535897931) * baseUnitValue) / 1e-6d,
+ RotationalSpeedUnit.MicroradianPerSecond => (baseUnitValue) / 1e-6d,
+ RotationalSpeedUnit.MillidegreePerSecond => ((180 / 3.1415926535897931) * baseUnitValue) / 1e-3d,
+ RotationalSpeedUnit.MilliradianPerSecond => (baseUnitValue) / 1e-3d,
+ RotationalSpeedUnit.NanodegreePerSecond => ((180 / 3.1415926535897931) * baseUnitValue) / 1e-9d,
+ RotationalSpeedUnit.NanoradianPerSecond => (baseUnitValue) / 1e-9d,
+ RotationalSpeedUnit.RadianPerSecond => baseUnitValue,
+ RotationalSpeedUnit.RevolutionPerMinute => (baseUnitValue / (2 * 3.1415926535897931)) * 60,
+ RotationalSpeedUnit.RevolutionPerSecond => baseUnitValue / (2 * 3.1415926535897931),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffness.g.cs
index b7e34514c8..b018e43b16 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffness.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffness.g.cs
@@ -435,119 +435,119 @@ public static RotationalStiffness From(double value, RotationalStiffnessUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RotationalStiffnessUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RotationalStiffness to another RotationalStiffness with the unit representation .
- ///
- /// A RotationalStiffness with the specified unit.
- public RotationalStiffness ToUnit(RotationalStiffnessUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RotationalStiffness(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RotationalStiffnessUnit.CentinewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-2d,
- RotationalStiffnessUnit.CentinewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-2d,
- RotationalStiffnessUnit.CentinewtonMillimeterPerRadian => (_value * 0.001) * 1e-2d,
- RotationalStiffnessUnit.DecanewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e1d,
- RotationalStiffnessUnit.DecanewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e1d,
- RotationalStiffnessUnit.DecanewtonMillimeterPerRadian => (_value * 0.001) * 1e1d,
- RotationalStiffnessUnit.DecinewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-1d,
- RotationalStiffnessUnit.DecinewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-1d,
- RotationalStiffnessUnit.DecinewtonMillimeterPerRadian => (_value * 0.001) * 1e-1d,
- RotationalStiffnessUnit.KilonewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e3d,
- RotationalStiffnessUnit.KilonewtonMeterPerRadian => (_value) * 1e3d,
- RotationalStiffnessUnit.KilonewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e3d,
- RotationalStiffnessUnit.KilonewtonMillimeterPerRadian => (_value * 0.001) * 1e3d,
- RotationalStiffnessUnit.KilopoundForceFootPerDegrees => _value * (4.4482216152605e3 * 0.3048 * 180 / 3.1415926535897931),
- RotationalStiffnessUnit.KilopoundForceFootPerRadian => _value * 4.4482216152605e3 * 0.3048,
- RotationalStiffnessUnit.MeganewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e6d,
- RotationalStiffnessUnit.MeganewtonMeterPerRadian => (_value) * 1e6d,
- RotationalStiffnessUnit.MeganewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e6d,
- RotationalStiffnessUnit.MeganewtonMillimeterPerRadian => (_value * 0.001) * 1e6d,
- RotationalStiffnessUnit.MicronewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-6d,
- RotationalStiffnessUnit.MicronewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-6d,
- RotationalStiffnessUnit.MicronewtonMillimeterPerRadian => (_value * 0.001) * 1e-6d,
- RotationalStiffnessUnit.MillinewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-3d,
- RotationalStiffnessUnit.MillinewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-3d,
- RotationalStiffnessUnit.MillinewtonMillimeterPerRadian => (_value * 0.001) * 1e-3d,
- RotationalStiffnessUnit.NanonewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-9d,
- RotationalStiffnessUnit.NanonewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-9d,
- RotationalStiffnessUnit.NanonewtonMillimeterPerRadian => (_value * 0.001) * 1e-9d,
- RotationalStiffnessUnit.NewtonMeterPerDegree => _value * (180 / 3.1415926535897931),
- RotationalStiffnessUnit.NewtonMeterPerRadian => _value,
- RotationalStiffnessUnit.NewtonMillimeterPerDegree => _value * 180 / 3.1415926535897931 * 0.001,
- RotationalStiffnessUnit.NewtonMillimeterPerRadian => _value * 0.001,
- RotationalStiffnessUnit.PoundForceFeetPerRadian => _value * 4.4482216152605 * 0.3048,
- RotationalStiffnessUnit.PoundForceFootPerDegrees => _value * (4.4482216152605 * 0.3048 * 180 / 3.1415926535897931),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RotationalStiffnessUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RotationalStiffnessUnit.CentinewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-2d,
- RotationalStiffnessUnit.CentinewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-2d,
- RotationalStiffnessUnit.CentinewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-2d,
- RotationalStiffnessUnit.DecanewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e1d,
- RotationalStiffnessUnit.DecanewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e1d,
- RotationalStiffnessUnit.DecanewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e1d,
- RotationalStiffnessUnit.DecinewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-1d,
- RotationalStiffnessUnit.DecinewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-1d,
- RotationalStiffnessUnit.DecinewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-1d,
- RotationalStiffnessUnit.KilonewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e3d,
- RotationalStiffnessUnit.KilonewtonMeterPerRadian => (baseUnitValue) / 1e3d,
- RotationalStiffnessUnit.KilonewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e3d,
- RotationalStiffnessUnit.KilonewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e3d,
- RotationalStiffnessUnit.KilopoundForceFootPerDegrees => baseUnitValue / (4.4482216152605e3 * 0.3048 * 180 / 3.1415926535897931),
- RotationalStiffnessUnit.KilopoundForceFootPerRadian => baseUnitValue / (4.4482216152605e3 * 0.3048),
- RotationalStiffnessUnit.MeganewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e6d,
- RotationalStiffnessUnit.MeganewtonMeterPerRadian => (baseUnitValue) / 1e6d,
- RotationalStiffnessUnit.MeganewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e6d,
- RotationalStiffnessUnit.MeganewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e6d,
- RotationalStiffnessUnit.MicronewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-6d,
- RotationalStiffnessUnit.MicronewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-6d,
- RotationalStiffnessUnit.MicronewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-6d,
- RotationalStiffnessUnit.MillinewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-3d,
- RotationalStiffnessUnit.MillinewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-3d,
- RotationalStiffnessUnit.MillinewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-3d,
- RotationalStiffnessUnit.NanonewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-9d,
- RotationalStiffnessUnit.NanonewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-9d,
- RotationalStiffnessUnit.NanonewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-9d,
- RotationalStiffnessUnit.NewtonMeterPerDegree => baseUnitValue / (180 / 3.1415926535897931),
- RotationalStiffnessUnit.NewtonMeterPerRadian => baseUnitValue,
- RotationalStiffnessUnit.NewtonMillimeterPerDegree => baseUnitValue / 180 * 3.1415926535897931 * 1000,
- RotationalStiffnessUnit.NewtonMillimeterPerRadian => baseUnitValue * 1000,
- RotationalStiffnessUnit.PoundForceFeetPerRadian => baseUnitValue / (4.4482216152605 * 0.3048),
- RotationalStiffnessUnit.PoundForceFootPerDegrees => baseUnitValue / (4.4482216152605 * 0.3048 * 180 / 3.1415926535897931),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RotationalStiffnessUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RotationalStiffness to another RotationalStiffness with the unit representation .
+ ///
+ /// A RotationalStiffness with the specified unit.
+ public RotationalStiffness ToUnit(RotationalStiffnessUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RotationalStiffness(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RotationalStiffnessUnit.CentinewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-2d,
+ RotationalStiffnessUnit.CentinewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-2d,
+ RotationalStiffnessUnit.CentinewtonMillimeterPerRadian => (_value * 0.001) * 1e-2d,
+ RotationalStiffnessUnit.DecanewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e1d,
+ RotationalStiffnessUnit.DecanewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e1d,
+ RotationalStiffnessUnit.DecanewtonMillimeterPerRadian => (_value * 0.001) * 1e1d,
+ RotationalStiffnessUnit.DecinewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-1d,
+ RotationalStiffnessUnit.DecinewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-1d,
+ RotationalStiffnessUnit.DecinewtonMillimeterPerRadian => (_value * 0.001) * 1e-1d,
+ RotationalStiffnessUnit.KilonewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e3d,
+ RotationalStiffnessUnit.KilonewtonMeterPerRadian => (_value) * 1e3d,
+ RotationalStiffnessUnit.KilonewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e3d,
+ RotationalStiffnessUnit.KilonewtonMillimeterPerRadian => (_value * 0.001) * 1e3d,
+ RotationalStiffnessUnit.KilopoundForceFootPerDegrees => _value * (4.4482216152605e3 * 0.3048 * 180 / 3.1415926535897931),
+ RotationalStiffnessUnit.KilopoundForceFootPerRadian => _value * 4.4482216152605e3 * 0.3048,
+ RotationalStiffnessUnit.MeganewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e6d,
+ RotationalStiffnessUnit.MeganewtonMeterPerRadian => (_value) * 1e6d,
+ RotationalStiffnessUnit.MeganewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e6d,
+ RotationalStiffnessUnit.MeganewtonMillimeterPerRadian => (_value * 0.001) * 1e6d,
+ RotationalStiffnessUnit.MicronewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-6d,
+ RotationalStiffnessUnit.MicronewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-6d,
+ RotationalStiffnessUnit.MicronewtonMillimeterPerRadian => (_value * 0.001) * 1e-6d,
+ RotationalStiffnessUnit.MillinewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-3d,
+ RotationalStiffnessUnit.MillinewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-3d,
+ RotationalStiffnessUnit.MillinewtonMillimeterPerRadian => (_value * 0.001) * 1e-3d,
+ RotationalStiffnessUnit.NanonewtonMeterPerDegree => (_value * (180 / 3.1415926535897931)) * 1e-9d,
+ RotationalStiffnessUnit.NanonewtonMillimeterPerDegree => (_value * 180 / 3.1415926535897931 * 0.001) * 1e-9d,
+ RotationalStiffnessUnit.NanonewtonMillimeterPerRadian => (_value * 0.001) * 1e-9d,
+ RotationalStiffnessUnit.NewtonMeterPerDegree => _value * (180 / 3.1415926535897931),
+ RotationalStiffnessUnit.NewtonMeterPerRadian => _value,
+ RotationalStiffnessUnit.NewtonMillimeterPerDegree => _value * 180 / 3.1415926535897931 * 0.001,
+ RotationalStiffnessUnit.NewtonMillimeterPerRadian => _value * 0.001,
+ RotationalStiffnessUnit.PoundForceFeetPerRadian => _value * 4.4482216152605 * 0.3048,
+ RotationalStiffnessUnit.PoundForceFootPerDegrees => _value * (4.4482216152605 * 0.3048 * 180 / 3.1415926535897931),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RotationalStiffnessUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RotationalStiffnessUnit.CentinewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-2d,
+ RotationalStiffnessUnit.CentinewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-2d,
+ RotationalStiffnessUnit.CentinewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-2d,
+ RotationalStiffnessUnit.DecanewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e1d,
+ RotationalStiffnessUnit.DecanewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e1d,
+ RotationalStiffnessUnit.DecanewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e1d,
+ RotationalStiffnessUnit.DecinewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-1d,
+ RotationalStiffnessUnit.DecinewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-1d,
+ RotationalStiffnessUnit.DecinewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-1d,
+ RotationalStiffnessUnit.KilonewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e3d,
+ RotationalStiffnessUnit.KilonewtonMeterPerRadian => (baseUnitValue) / 1e3d,
+ RotationalStiffnessUnit.KilonewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e3d,
+ RotationalStiffnessUnit.KilonewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e3d,
+ RotationalStiffnessUnit.KilopoundForceFootPerDegrees => baseUnitValue / (4.4482216152605e3 * 0.3048 * 180 / 3.1415926535897931),
+ RotationalStiffnessUnit.KilopoundForceFootPerRadian => baseUnitValue / (4.4482216152605e3 * 0.3048),
+ RotationalStiffnessUnit.MeganewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e6d,
+ RotationalStiffnessUnit.MeganewtonMeterPerRadian => (baseUnitValue) / 1e6d,
+ RotationalStiffnessUnit.MeganewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e6d,
+ RotationalStiffnessUnit.MeganewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e6d,
+ RotationalStiffnessUnit.MicronewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-6d,
+ RotationalStiffnessUnit.MicronewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-6d,
+ RotationalStiffnessUnit.MicronewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-6d,
+ RotationalStiffnessUnit.MillinewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-3d,
+ RotationalStiffnessUnit.MillinewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-3d,
+ RotationalStiffnessUnit.MillinewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-3d,
+ RotationalStiffnessUnit.NanonewtonMeterPerDegree => (baseUnitValue / (180 / 3.1415926535897931)) / 1e-9d,
+ RotationalStiffnessUnit.NanonewtonMillimeterPerDegree => (baseUnitValue / 180 * 3.1415926535897931 * 1000) / 1e-9d,
+ RotationalStiffnessUnit.NanonewtonMillimeterPerRadian => (baseUnitValue * 1000) / 1e-9d,
+ RotationalStiffnessUnit.NewtonMeterPerDegree => baseUnitValue / (180 / 3.1415926535897931),
+ RotationalStiffnessUnit.NewtonMeterPerRadian => baseUnitValue,
+ RotationalStiffnessUnit.NewtonMillimeterPerDegree => baseUnitValue / 180 * 3.1415926535897931 * 1000,
+ RotationalStiffnessUnit.NewtonMillimeterPerRadian => baseUnitValue * 1000,
+ RotationalStiffnessUnit.PoundForceFeetPerRadian => baseUnitValue / (4.4482216152605 * 0.3048),
+ RotationalStiffnessUnit.PoundForceFootPerDegrees => baseUnitValue / (4.4482216152605 * 0.3048 * 180 / 3.1415926535897931),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs
index 9ace4bbc80..cc55279803 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs
@@ -145,61 +145,61 @@ public static RotationalStiffnessPerLength From(double value, RotationalStiffnes
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(RotationalStiffnessPerLengthUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this RotationalStiffnessPerLength to another RotationalStiffnessPerLength with the unit representation .
- ///
- /// A RotationalStiffnessPerLength with the specified unit.
- public RotationalStiffnessPerLength ToUnit(RotationalStiffnessPerLengthUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new RotationalStiffnessPerLength(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter => (_value) * 1e3d,
- RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot => _value * (4.4482216152605e3 * 180 / 3.1415926535897931),
- RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter => (_value) * 1e6d,
- RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter => _value,
- RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot => _value * (4.4482216152605 * 180 / 3.1415926535897931),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(RotationalStiffnessPerLengthUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter => (baseUnitValue) / 1e3d,
- RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot => baseUnitValue / (4.4482216152605e3 * 180 / 3.1415926535897931),
- RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter => (baseUnitValue) / 1e6d,
- RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter => baseUnitValue,
- RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot => baseUnitValue / (4.4482216152605 * 180 / 3.1415926535897931),
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(RotationalStiffnessPerLengthUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this RotationalStiffnessPerLength to another RotationalStiffnessPerLength with the unit representation .
+ ///
+ /// A RotationalStiffnessPerLength with the specified unit.
+ public RotationalStiffnessPerLength ToUnit(RotationalStiffnessPerLengthUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new RotationalStiffnessPerLength(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter => (_value) * 1e3d,
+ RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot => _value * (4.4482216152605e3 * 180 / 3.1415926535897931),
+ RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter => (_value) * 1e6d,
+ RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter => _value,
+ RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot => _value * (4.4482216152605 * 180 / 3.1415926535897931),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(RotationalStiffnessPerLengthUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ RotationalStiffnessPerLengthUnit.KilonewtonMeterPerRadianPerMeter => (baseUnitValue) / 1e3d,
+ RotationalStiffnessPerLengthUnit.KilopoundForceFootPerDegreesPerFoot => baseUnitValue / (4.4482216152605e3 * 180 / 3.1415926535897931),
+ RotationalStiffnessPerLengthUnit.MeganewtonMeterPerRadianPerMeter => (baseUnitValue) / 1e6d,
+ RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter => baseUnitValue,
+ RotationalStiffnessPerLengthUnit.PoundForceFootPerDegreesPerFoot => baseUnitValue / (4.4482216152605 * 180 / 3.1415926535897931),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs
index 2f39ceaf42..c78c295bfd 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Scalar.g.cs
@@ -105,53 +105,53 @@ public static Scalar From(double value, ScalarUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ScalarUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Scalar to another Scalar with the unit representation .
- ///
- /// A Scalar with the specified unit.
- public Scalar ToUnit(ScalarUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Scalar(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ScalarUnit.Amount => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ScalarUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ScalarUnit.Amount => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ScalarUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Scalar to another Scalar with the unit representation .
+ ///
+ /// A Scalar with the specified unit.
+ public Scalar ToUnit(ScalarUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Scalar(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ScalarUnit.Amount => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ScalarUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ScalarUnit.Amount => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SolidAngle.g.cs
index 4f5508a823..29b2a765d1 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SolidAngle.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SolidAngle.g.cs
@@ -108,53 +108,53 @@ public static SolidAngle From(double value, SolidAngleUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SolidAngleUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this SolidAngle to another SolidAngle with the unit representation .
- ///
- /// A SolidAngle with the specified unit.
- public SolidAngle ToUnit(SolidAngleUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new SolidAngle(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SolidAngleUnit.Steradian => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SolidAngleUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SolidAngleUnit.Steradian => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SolidAngleUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this SolidAngle to another SolidAngle with the unit representation .
+ ///
+ /// A SolidAngle with the specified unit.
+ public SolidAngle ToUnit(SolidAngleUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new SolidAngle(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SolidAngleUnit.Steradian => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SolidAngleUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SolidAngleUnit.Steradian => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs
index 294728402a..fe5d389a69 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEnergy.g.cs
@@ -398,111 +398,111 @@ public static SpecificEnergy From(double value, SpecificEnergyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SpecificEnergyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this SpecificEnergy to another SpecificEnergy with the unit representation .
- ///
- /// A SpecificEnergy with the specified unit.
- public SpecificEnergy ToUnit(SpecificEnergyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new SpecificEnergy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SpecificEnergyUnit.BtuPerPound => _value * 1055.05585262 / 0.45359237,
- SpecificEnergyUnit.CaloriePerGram => _value * 4.184e3,
- SpecificEnergyUnit.GigawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e9d,
- SpecificEnergyUnit.GigawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e9d,
- SpecificEnergyUnit.GigawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e9d,
- SpecificEnergyUnit.GigawattHourPerKilogram => (_value * 3.6e3) * 1e9d,
- SpecificEnergyUnit.GigawattHourPerPound => (_value * 7.93664e3) * 1e9d,
- SpecificEnergyUnit.JoulePerKilogram => _value,
- SpecificEnergyUnit.KilocaloriePerGram => (_value * 4.184e3) * 1e3d,
- SpecificEnergyUnit.KilojoulePerKilogram => (_value) * 1e3d,
- SpecificEnergyUnit.KilowattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e3d,
- SpecificEnergyUnit.KilowattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e3d,
- SpecificEnergyUnit.KilowattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e3d,
- SpecificEnergyUnit.KilowattHourPerKilogram => (_value * 3.6e3) * 1e3d,
- SpecificEnergyUnit.KilowattHourPerPound => (_value * 7.93664e3) * 1e3d,
- SpecificEnergyUnit.MegajoulePerKilogram => (_value) * 1e6d,
- SpecificEnergyUnit.MegajoulePerTonne => _value * 1e3,
- SpecificEnergyUnit.MegawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e6d,
- SpecificEnergyUnit.MegawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e6d,
- SpecificEnergyUnit.MegawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e6d,
- SpecificEnergyUnit.MegawattHourPerKilogram => (_value * 3.6e3) * 1e6d,
- SpecificEnergyUnit.MegawattHourPerPound => (_value * 7.93664e3) * 1e6d,
- SpecificEnergyUnit.TerawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e12d,
- SpecificEnergyUnit.TerawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e12d,
- SpecificEnergyUnit.TerawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e12d,
- SpecificEnergyUnit.WattDayPerKilogram => _value * (24 * 3.6e3),
- SpecificEnergyUnit.WattDayPerShortTon => _value * ((24 * 3.6e3) / 9.0718474e2),
- SpecificEnergyUnit.WattDayPerTonne => _value * ((24 * 3.6e3) / 1e3),
- SpecificEnergyUnit.WattHourPerKilogram => _value * 3.6e3,
- SpecificEnergyUnit.WattHourPerPound => _value * 7.93664e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SpecificEnergyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SpecificEnergyUnit.BtuPerPound => baseUnitValue * 0.45359237 / 1055.05585262,
- SpecificEnergyUnit.CaloriePerGram => baseUnitValue / 4.184e3,
- SpecificEnergyUnit.GigawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e9d,
- SpecificEnergyUnit.GigawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e9d,
- SpecificEnergyUnit.GigawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e9d,
- SpecificEnergyUnit.GigawattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e9d,
- SpecificEnergyUnit.GigawattHourPerPound => (baseUnitValue / 7.93664e3) / 1e9d,
- SpecificEnergyUnit.JoulePerKilogram => baseUnitValue,
- SpecificEnergyUnit.KilocaloriePerGram => (baseUnitValue / 4.184e3) / 1e3d,
- SpecificEnergyUnit.KilojoulePerKilogram => (baseUnitValue) / 1e3d,
- SpecificEnergyUnit.KilowattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e3d,
- SpecificEnergyUnit.KilowattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e3d,
- SpecificEnergyUnit.KilowattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e3d,
- SpecificEnergyUnit.KilowattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e3d,
- SpecificEnergyUnit.KilowattHourPerPound => (baseUnitValue / 7.93664e3) / 1e3d,
- SpecificEnergyUnit.MegajoulePerKilogram => (baseUnitValue) / 1e6d,
- SpecificEnergyUnit.MegajoulePerTonne => baseUnitValue / 1e3,
- SpecificEnergyUnit.MegawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e6d,
- SpecificEnergyUnit.MegawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e6d,
- SpecificEnergyUnit.MegawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e6d,
- SpecificEnergyUnit.MegawattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e6d,
- SpecificEnergyUnit.MegawattHourPerPound => (baseUnitValue / 7.93664e3) / 1e6d,
- SpecificEnergyUnit.TerawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e12d,
- SpecificEnergyUnit.TerawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e12d,
- SpecificEnergyUnit.TerawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e12d,
- SpecificEnergyUnit.WattDayPerKilogram => baseUnitValue / (24 * 3.6e3),
- SpecificEnergyUnit.WattDayPerShortTon => baseUnitValue / ((24 * 3.6e3) / 9.0718474e2),
- SpecificEnergyUnit.WattDayPerTonne => baseUnitValue / ((24 * 3.6e3) / 1e3),
- SpecificEnergyUnit.WattHourPerKilogram => baseUnitValue / 3.6e3,
- SpecificEnergyUnit.WattHourPerPound => baseUnitValue / 7.93664e3,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SpecificEnergyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this SpecificEnergy to another SpecificEnergy with the unit representation .
+ ///
+ /// A SpecificEnergy with the specified unit.
+ public SpecificEnergy ToUnit(SpecificEnergyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new SpecificEnergy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SpecificEnergyUnit.BtuPerPound => _value * 1055.05585262 / 0.45359237,
+ SpecificEnergyUnit.CaloriePerGram => _value * 4.184e3,
+ SpecificEnergyUnit.GigawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e9d,
+ SpecificEnergyUnit.GigawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e9d,
+ SpecificEnergyUnit.GigawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e9d,
+ SpecificEnergyUnit.GigawattHourPerKilogram => (_value * 3.6e3) * 1e9d,
+ SpecificEnergyUnit.GigawattHourPerPound => (_value * 7.93664e3) * 1e9d,
+ SpecificEnergyUnit.JoulePerKilogram => _value,
+ SpecificEnergyUnit.KilocaloriePerGram => (_value * 4.184e3) * 1e3d,
+ SpecificEnergyUnit.KilojoulePerKilogram => (_value) * 1e3d,
+ SpecificEnergyUnit.KilowattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e3d,
+ SpecificEnergyUnit.KilowattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e3d,
+ SpecificEnergyUnit.KilowattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e3d,
+ SpecificEnergyUnit.KilowattHourPerKilogram => (_value * 3.6e3) * 1e3d,
+ SpecificEnergyUnit.KilowattHourPerPound => (_value * 7.93664e3) * 1e3d,
+ SpecificEnergyUnit.MegajoulePerKilogram => (_value) * 1e6d,
+ SpecificEnergyUnit.MegajoulePerTonne => _value * 1e3,
+ SpecificEnergyUnit.MegawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e6d,
+ SpecificEnergyUnit.MegawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e6d,
+ SpecificEnergyUnit.MegawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e6d,
+ SpecificEnergyUnit.MegawattHourPerKilogram => (_value * 3.6e3) * 1e6d,
+ SpecificEnergyUnit.MegawattHourPerPound => (_value * 7.93664e3) * 1e6d,
+ SpecificEnergyUnit.TerawattDayPerKilogram => (_value * (24 * 3.6e3)) * 1e12d,
+ SpecificEnergyUnit.TerawattDayPerShortTon => (_value * ((24 * 3.6e3) / 9.0718474e2)) * 1e12d,
+ SpecificEnergyUnit.TerawattDayPerTonne => (_value * ((24 * 3.6e3) / 1e3)) * 1e12d,
+ SpecificEnergyUnit.WattDayPerKilogram => _value * (24 * 3.6e3),
+ SpecificEnergyUnit.WattDayPerShortTon => _value * ((24 * 3.6e3) / 9.0718474e2),
+ SpecificEnergyUnit.WattDayPerTonne => _value * ((24 * 3.6e3) / 1e3),
+ SpecificEnergyUnit.WattHourPerKilogram => _value * 3.6e3,
+ SpecificEnergyUnit.WattHourPerPound => _value * 7.93664e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SpecificEnergyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SpecificEnergyUnit.BtuPerPound => baseUnitValue * 0.45359237 / 1055.05585262,
+ SpecificEnergyUnit.CaloriePerGram => baseUnitValue / 4.184e3,
+ SpecificEnergyUnit.GigawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e9d,
+ SpecificEnergyUnit.GigawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e9d,
+ SpecificEnergyUnit.GigawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e9d,
+ SpecificEnergyUnit.GigawattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e9d,
+ SpecificEnergyUnit.GigawattHourPerPound => (baseUnitValue / 7.93664e3) / 1e9d,
+ SpecificEnergyUnit.JoulePerKilogram => baseUnitValue,
+ SpecificEnergyUnit.KilocaloriePerGram => (baseUnitValue / 4.184e3) / 1e3d,
+ SpecificEnergyUnit.KilojoulePerKilogram => (baseUnitValue) / 1e3d,
+ SpecificEnergyUnit.KilowattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e3d,
+ SpecificEnergyUnit.KilowattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e3d,
+ SpecificEnergyUnit.KilowattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e3d,
+ SpecificEnergyUnit.KilowattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e3d,
+ SpecificEnergyUnit.KilowattHourPerPound => (baseUnitValue / 7.93664e3) / 1e3d,
+ SpecificEnergyUnit.MegajoulePerKilogram => (baseUnitValue) / 1e6d,
+ SpecificEnergyUnit.MegajoulePerTonne => baseUnitValue / 1e3,
+ SpecificEnergyUnit.MegawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e6d,
+ SpecificEnergyUnit.MegawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e6d,
+ SpecificEnergyUnit.MegawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e6d,
+ SpecificEnergyUnit.MegawattHourPerKilogram => (baseUnitValue / 3.6e3) / 1e6d,
+ SpecificEnergyUnit.MegawattHourPerPound => (baseUnitValue / 7.93664e3) / 1e6d,
+ SpecificEnergyUnit.TerawattDayPerKilogram => (baseUnitValue / (24 * 3.6e3)) / 1e12d,
+ SpecificEnergyUnit.TerawattDayPerShortTon => (baseUnitValue / ((24 * 3.6e3) / 9.0718474e2)) / 1e12d,
+ SpecificEnergyUnit.TerawattDayPerTonne => (baseUnitValue / ((24 * 3.6e3) / 1e3)) / 1e12d,
+ SpecificEnergyUnit.WattDayPerKilogram => baseUnitValue / (24 * 3.6e3),
+ SpecificEnergyUnit.WattDayPerShortTon => baseUnitValue / ((24 * 3.6e3) / 9.0718474e2),
+ SpecificEnergyUnit.WattDayPerTonne => baseUnitValue / ((24 * 3.6e3) / 1e3),
+ SpecificEnergyUnit.WattHourPerKilogram => baseUnitValue / 3.6e3,
+ SpecificEnergyUnit.WattHourPerPound => baseUnitValue / 7.93664e3,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEntropy.g.cs
index f904002032..b28ee3529d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEntropy.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificEntropy.g.cs
@@ -185,69 +185,69 @@ public static SpecificEntropy From(double value, SpecificEntropyUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SpecificEntropyUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this SpecificEntropy to another SpecificEntropy with the unit representation .
- ///
- /// A SpecificEntropy with the specified unit.
- public SpecificEntropy ToUnit(SpecificEntropyUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new SpecificEntropy(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SpecificEntropyUnit.BtuPerPoundFahrenheit => _value * 4.1868e3,
- SpecificEntropyUnit.CaloriePerGramKelvin => _value * 4.184e3,
- SpecificEntropyUnit.JoulePerKilogramDegreeCelsius => _value,
- SpecificEntropyUnit.JoulePerKilogramKelvin => _value,
- SpecificEntropyUnit.KilocaloriePerGramKelvin => (_value * 4.184e3) * 1e3d,
- SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius => (_value) * 1e3d,
- SpecificEntropyUnit.KilojoulePerKilogramKelvin => (_value) * 1e3d,
- SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius => (_value) * 1e6d,
- SpecificEntropyUnit.MegajoulePerKilogramKelvin => (_value) * 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SpecificEntropyUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SpecificEntropyUnit.BtuPerPoundFahrenheit => baseUnitValue / 4.1868e3,
- SpecificEntropyUnit.CaloriePerGramKelvin => baseUnitValue / 4.184e3,
- SpecificEntropyUnit.JoulePerKilogramDegreeCelsius => baseUnitValue,
- SpecificEntropyUnit.JoulePerKilogramKelvin => baseUnitValue,
- SpecificEntropyUnit.KilocaloriePerGramKelvin => (baseUnitValue / 4.184e3) / 1e3d,
- SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius => (baseUnitValue) / 1e3d,
- SpecificEntropyUnit.KilojoulePerKilogramKelvin => (baseUnitValue) / 1e3d,
- SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius => (baseUnitValue) / 1e6d,
- SpecificEntropyUnit.MegajoulePerKilogramKelvin => (baseUnitValue) / 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SpecificEntropyUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this SpecificEntropy to another SpecificEntropy with the unit representation .
+ ///
+ /// A SpecificEntropy with the specified unit.
+ public SpecificEntropy ToUnit(SpecificEntropyUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new SpecificEntropy(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SpecificEntropyUnit.BtuPerPoundFahrenheit => _value * 4.1868e3,
+ SpecificEntropyUnit.CaloriePerGramKelvin => _value * 4.184e3,
+ SpecificEntropyUnit.JoulePerKilogramDegreeCelsius => _value,
+ SpecificEntropyUnit.JoulePerKilogramKelvin => _value,
+ SpecificEntropyUnit.KilocaloriePerGramKelvin => (_value * 4.184e3) * 1e3d,
+ SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius => (_value) * 1e3d,
+ SpecificEntropyUnit.KilojoulePerKilogramKelvin => (_value) * 1e3d,
+ SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius => (_value) * 1e6d,
+ SpecificEntropyUnit.MegajoulePerKilogramKelvin => (_value) * 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SpecificEntropyUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SpecificEntropyUnit.BtuPerPoundFahrenheit => baseUnitValue / 4.1868e3,
+ SpecificEntropyUnit.CaloriePerGramKelvin => baseUnitValue / 4.184e3,
+ SpecificEntropyUnit.JoulePerKilogramDegreeCelsius => baseUnitValue,
+ SpecificEntropyUnit.JoulePerKilogramKelvin => baseUnitValue,
+ SpecificEntropyUnit.KilocaloriePerGramKelvin => (baseUnitValue / 4.184e3) / 1e3d,
+ SpecificEntropyUnit.KilojoulePerKilogramDegreeCelsius => (baseUnitValue) / 1e3d,
+ SpecificEntropyUnit.KilojoulePerKilogramKelvin => (baseUnitValue) / 1e3d,
+ SpecificEntropyUnit.MegajoulePerKilogramDegreeCelsius => (baseUnitValue) / 1e6d,
+ SpecificEntropyUnit.MegajoulePerKilogramKelvin => (baseUnitValue) / 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs
index 21ca83be63..6ce60cb875 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificFuelConsumption.g.cs
@@ -138,59 +138,59 @@ public static SpecificFuelConsumption From(double value, SpecificFuelConsumption
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SpecificFuelConsumptionUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this SpecificFuelConsumption to another SpecificFuelConsumption with the unit representation .
- ///
- /// A SpecificFuelConsumption with the specified unit.
- public SpecificFuelConsumption ToUnit(SpecificFuelConsumptionUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new SpecificFuelConsumption(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SpecificFuelConsumptionUnit.GramPerKilonewtonSecond => _value,
- SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour => _value * 1000 / (9.80665e-3 * 3600),
- SpecificFuelConsumptionUnit.KilogramPerKilonewtonSecond => (_value) * 1e3d,
- SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour => _value * 1000 / (9.80665e-3 * 3600),
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SpecificFuelConsumptionUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SpecificFuelConsumptionUnit.GramPerKilonewtonSecond => baseUnitValue,
- SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour => baseUnitValue * 9.80665e-3 * 3600 / 1000,
- SpecificFuelConsumptionUnit.KilogramPerKilonewtonSecond => (baseUnitValue) / 1e3d,
- SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour => baseUnitValue * 9.80665e-3 * 3600 / 1000,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SpecificFuelConsumptionUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this SpecificFuelConsumption to another SpecificFuelConsumption with the unit representation .
+ ///
+ /// A SpecificFuelConsumption with the specified unit.
+ public SpecificFuelConsumption ToUnit(SpecificFuelConsumptionUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new SpecificFuelConsumption(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SpecificFuelConsumptionUnit.GramPerKilonewtonSecond => _value,
+ SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour => _value * 1000 / (9.80665e-3 * 3600),
+ SpecificFuelConsumptionUnit.KilogramPerKilonewtonSecond => (_value) * 1e3d,
+ SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour => _value * 1000 / (9.80665e-3 * 3600),
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SpecificFuelConsumptionUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SpecificFuelConsumptionUnit.GramPerKilonewtonSecond => baseUnitValue,
+ SpecificFuelConsumptionUnit.KilogramPerKilogramForceHour => baseUnitValue * 9.80665e-3 * 3600 / 1000,
+ SpecificFuelConsumptionUnit.KilogramPerKilonewtonSecond => (baseUnitValue) / 1e3d,
+ SpecificFuelConsumptionUnit.PoundMassPerPoundForceHour => baseUnitValue * 9.80665e-3 * 3600 / 1000,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificVolume.g.cs
index 05c9f8554e..47a7cb0c09 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificVolume.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificVolume.g.cs
@@ -125,57 +125,57 @@ public static SpecificVolume From(double value, SpecificVolumeUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SpecificVolumeUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this SpecificVolume to another SpecificVolume with the unit representation .
- ///
- /// A SpecificVolume with the specified unit.
- public SpecificVolume ToUnit(SpecificVolumeUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new SpecificVolume(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SpecificVolumeUnit.CubicFootPerPound => _value * 0.028316846592 / 0.45359237,
- SpecificVolumeUnit.CubicMeterPerKilogram => _value,
- SpecificVolumeUnit.MillicubicMeterPerKilogram => (_value) * 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SpecificVolumeUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SpecificVolumeUnit.CubicFootPerPound => baseUnitValue * 0.45359237 / 0.028316846592,
- SpecificVolumeUnit.CubicMeterPerKilogram => baseUnitValue,
- SpecificVolumeUnit.MillicubicMeterPerKilogram => (baseUnitValue) / 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SpecificVolumeUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this SpecificVolume to another SpecificVolume with the unit representation .
+ ///
+ /// A SpecificVolume with the specified unit.
+ public SpecificVolume ToUnit(SpecificVolumeUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new SpecificVolume(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SpecificVolumeUnit.CubicFootPerPound => _value * 0.028316846592 / 0.45359237,
+ SpecificVolumeUnit.CubicMeterPerKilogram => _value,
+ SpecificVolumeUnit.MillicubicMeterPerKilogram => (_value) * 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SpecificVolumeUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SpecificVolumeUnit.CubicFootPerPound => baseUnitValue * 0.45359237 / 0.028316846592,
+ SpecificVolumeUnit.CubicMeterPerKilogram => baseUnitValue,
+ SpecificVolumeUnit.MillicubicMeterPerKilogram => (baseUnitValue) / 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificWeight.g.cs
index 24c900aaee..7b464667da 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificWeight.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/SpecificWeight.g.cs
@@ -268,85 +268,85 @@ public static SpecificWeight From(double value, SpecificWeightUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SpecificWeightUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this SpecificWeight to another SpecificWeight with the unit representation .
- ///
- /// A SpecificWeight with the specified unit.
- public SpecificWeight ToUnit(SpecificWeightUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new SpecificWeight(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SpecificWeightUnit.KilogramForcePerCubicCentimeter => _value * 9.80665e6,
- SpecificWeightUnit.KilogramForcePerCubicMeter => _value * 9.80665,
- SpecificWeightUnit.KilogramForcePerCubicMillimeter => _value * 9.80665e9,
- SpecificWeightUnit.KilonewtonPerCubicCentimeter => (_value * 1000000) * 1e3d,
- SpecificWeightUnit.KilonewtonPerCubicMeter => (_value) * 1e3d,
- SpecificWeightUnit.KilonewtonPerCubicMillimeter => (_value * 1000000000) * 1e3d,
- SpecificWeightUnit.KilopoundForcePerCubicFoot => (_value * 4.4482216152605 / 0.028316846592) * 1e3d,
- SpecificWeightUnit.KilopoundForcePerCubicInch => (_value * 4.4482216152605 / 1.6387064e-5) * 1e3d,
- SpecificWeightUnit.MeganewtonPerCubicMeter => (_value) * 1e6d,
- SpecificWeightUnit.NewtonPerCubicCentimeter => _value * 1000000,
- SpecificWeightUnit.NewtonPerCubicMeter => _value,
- SpecificWeightUnit.NewtonPerCubicMillimeter => _value * 1000000000,
- SpecificWeightUnit.PoundForcePerCubicFoot => _value * 4.4482216152605 / 0.028316846592,
- SpecificWeightUnit.PoundForcePerCubicInch => _value * 4.4482216152605 / 1.6387064e-5,
- SpecificWeightUnit.TonneForcePerCubicCentimeter => _value * 9.80665e9,
- SpecificWeightUnit.TonneForcePerCubicMeter => _value * 9.80665e3,
- SpecificWeightUnit.TonneForcePerCubicMillimeter => _value * 9.80665e12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SpecificWeightUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SpecificWeightUnit.KilogramForcePerCubicCentimeter => baseUnitValue / 9.80665e6,
- SpecificWeightUnit.KilogramForcePerCubicMeter => baseUnitValue / 9.80665,
- SpecificWeightUnit.KilogramForcePerCubicMillimeter => baseUnitValue / 9.80665e9,
- SpecificWeightUnit.KilonewtonPerCubicCentimeter => (baseUnitValue * 0.000001) / 1e3d,
- SpecificWeightUnit.KilonewtonPerCubicMeter => (baseUnitValue) / 1e3d,
- SpecificWeightUnit.KilonewtonPerCubicMillimeter => (baseUnitValue * 0.000000001) / 1e3d,
- SpecificWeightUnit.KilopoundForcePerCubicFoot => (baseUnitValue * 0.028316846592 / 4.4482216152605) / 1e3d,
- SpecificWeightUnit.KilopoundForcePerCubicInch => (baseUnitValue * 1.6387064e-5 / 4.4482216152605) / 1e3d,
- SpecificWeightUnit.MeganewtonPerCubicMeter => (baseUnitValue) / 1e6d,
- SpecificWeightUnit.NewtonPerCubicCentimeter => baseUnitValue * 0.000001,
- SpecificWeightUnit.NewtonPerCubicMeter => baseUnitValue,
- SpecificWeightUnit.NewtonPerCubicMillimeter => baseUnitValue * 0.000000001,
- SpecificWeightUnit.PoundForcePerCubicFoot => baseUnitValue * 0.028316846592 / 4.4482216152605,
- SpecificWeightUnit.PoundForcePerCubicInch => baseUnitValue * 1.6387064e-5 / 4.4482216152605,
- SpecificWeightUnit.TonneForcePerCubicCentimeter => baseUnitValue / 9.80665e9,
- SpecificWeightUnit.TonneForcePerCubicMeter => baseUnitValue / 9.80665e3,
- SpecificWeightUnit.TonneForcePerCubicMillimeter => baseUnitValue / 9.80665e12,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SpecificWeightUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this SpecificWeight to another SpecificWeight with the unit representation .
+ ///
+ /// A SpecificWeight with the specified unit.
+ public SpecificWeight ToUnit(SpecificWeightUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new SpecificWeight(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SpecificWeightUnit.KilogramForcePerCubicCentimeter => _value * 9.80665e6,
+ SpecificWeightUnit.KilogramForcePerCubicMeter => _value * 9.80665,
+ SpecificWeightUnit.KilogramForcePerCubicMillimeter => _value * 9.80665e9,
+ SpecificWeightUnit.KilonewtonPerCubicCentimeter => (_value * 1000000) * 1e3d,
+ SpecificWeightUnit.KilonewtonPerCubicMeter => (_value) * 1e3d,
+ SpecificWeightUnit.KilonewtonPerCubicMillimeter => (_value * 1000000000) * 1e3d,
+ SpecificWeightUnit.KilopoundForcePerCubicFoot => (_value * 4.4482216152605 / 0.028316846592) * 1e3d,
+ SpecificWeightUnit.KilopoundForcePerCubicInch => (_value * 4.4482216152605 / 1.6387064e-5) * 1e3d,
+ SpecificWeightUnit.MeganewtonPerCubicMeter => (_value) * 1e6d,
+ SpecificWeightUnit.NewtonPerCubicCentimeter => _value * 1000000,
+ SpecificWeightUnit.NewtonPerCubicMeter => _value,
+ SpecificWeightUnit.NewtonPerCubicMillimeter => _value * 1000000000,
+ SpecificWeightUnit.PoundForcePerCubicFoot => _value * 4.4482216152605 / 0.028316846592,
+ SpecificWeightUnit.PoundForcePerCubicInch => _value * 4.4482216152605 / 1.6387064e-5,
+ SpecificWeightUnit.TonneForcePerCubicCentimeter => _value * 9.80665e9,
+ SpecificWeightUnit.TonneForcePerCubicMeter => _value * 9.80665e3,
+ SpecificWeightUnit.TonneForcePerCubicMillimeter => _value * 9.80665e12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SpecificWeightUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SpecificWeightUnit.KilogramForcePerCubicCentimeter => baseUnitValue / 9.80665e6,
+ SpecificWeightUnit.KilogramForcePerCubicMeter => baseUnitValue / 9.80665,
+ SpecificWeightUnit.KilogramForcePerCubicMillimeter => baseUnitValue / 9.80665e9,
+ SpecificWeightUnit.KilonewtonPerCubicCentimeter => (baseUnitValue * 0.000001) / 1e3d,
+ SpecificWeightUnit.KilonewtonPerCubicMeter => (baseUnitValue) / 1e3d,
+ SpecificWeightUnit.KilonewtonPerCubicMillimeter => (baseUnitValue * 0.000000001) / 1e3d,
+ SpecificWeightUnit.KilopoundForcePerCubicFoot => (baseUnitValue * 0.028316846592 / 4.4482216152605) / 1e3d,
+ SpecificWeightUnit.KilopoundForcePerCubicInch => (baseUnitValue * 1.6387064e-5 / 4.4482216152605) / 1e3d,
+ SpecificWeightUnit.MeganewtonPerCubicMeter => (baseUnitValue) / 1e6d,
+ SpecificWeightUnit.NewtonPerCubicCentimeter => baseUnitValue * 0.000001,
+ SpecificWeightUnit.NewtonPerCubicMeter => baseUnitValue,
+ SpecificWeightUnit.NewtonPerCubicMillimeter => baseUnitValue * 0.000000001,
+ SpecificWeightUnit.PoundForcePerCubicFoot => baseUnitValue * 0.028316846592 / 4.4482216152605,
+ SpecificWeightUnit.PoundForcePerCubicInch => baseUnitValue * 1.6387064e-5 / 4.4482216152605,
+ SpecificWeightUnit.TonneForcePerCubicCentimeter => baseUnitValue / 9.80665e9,
+ SpecificWeightUnit.TonneForcePerCubicMeter => baseUnitValue / 9.80665e3,
+ SpecificWeightUnit.TonneForcePerCubicMillimeter => baseUnitValue / 9.80665e12,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs
index 2532a96562..ae16f6aa88 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Speed.g.cs
@@ -425,117 +425,117 @@ public static Speed From(double value, SpeedUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(SpeedUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Speed to another Speed with the unit representation .
- ///
- /// A Speed with the specified unit.
- public Speed ToUnit(SpeedUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Speed(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- SpeedUnit.CentimeterPerHour => (_value / 3600) * 1e-2d,
- SpeedUnit.CentimeterPerMinute => (_value / 60) * 1e-2d,
- SpeedUnit.CentimeterPerSecond => (_value) * 1e-2d,
- SpeedUnit.DecimeterPerMinute => (_value / 60) * 1e-1d,
- SpeedUnit.DecimeterPerSecond => (_value) * 1e-1d,
- SpeedUnit.FootPerHour => _value * 0.3048 / 3600,
- SpeedUnit.FootPerMinute => _value * 0.3048 / 60,
- SpeedUnit.FootPerSecond => _value * 0.3048,
- SpeedUnit.InchPerHour => (_value / 3600) * 2.54e-2,
- SpeedUnit.InchPerMinute => (_value / 60) * 2.54e-2,
- SpeedUnit.InchPerSecond => _value * 2.54e-2,
- SpeedUnit.KilometerPerHour => (_value / 3600) * 1e3d,
- SpeedUnit.KilometerPerMinute => (_value / 60) * 1e3d,
- SpeedUnit.KilometerPerSecond => (_value) * 1e3d,
- SpeedUnit.Knot => _value * (1852.0 / 3600.0),
- SpeedUnit.Mach => _value * 340.29,
- SpeedUnit.MeterPerHour => _value / 3600,
- SpeedUnit.MeterPerMinute => _value / 60,
- SpeedUnit.MeterPerSecond => _value,
- SpeedUnit.MicrometerPerMinute => (_value / 60) * 1e-6d,
- SpeedUnit.MicrometerPerSecond => (_value) * 1e-6d,
- SpeedUnit.MilePerHour => _value * 0.44704,
- SpeedUnit.MillimeterPerHour => (_value / 3600) * 1e-3d,
- SpeedUnit.MillimeterPerMinute => (_value / 60) * 1e-3d,
- SpeedUnit.MillimeterPerSecond => (_value) * 1e-3d,
- SpeedUnit.NanometerPerMinute => (_value / 60) * 1e-9d,
- SpeedUnit.NanometerPerSecond => (_value) * 1e-9d,
- SpeedUnit.UsSurveyFootPerHour => (_value * 1200 / 3937) / 3600,
- SpeedUnit.UsSurveyFootPerMinute => (_value * 1200 / 3937) / 60,
- SpeedUnit.UsSurveyFootPerSecond => _value * 1200 / 3937,
- SpeedUnit.YardPerHour => _value * 0.9144 / 3600,
- SpeedUnit.YardPerMinute => _value * 0.9144 / 60,
- SpeedUnit.YardPerSecond => _value * 0.9144,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(SpeedUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- SpeedUnit.CentimeterPerHour => (baseUnitValue * 3600) / 1e-2d,
- SpeedUnit.CentimeterPerMinute => (baseUnitValue * 60) / 1e-2d,
- SpeedUnit.CentimeterPerSecond => (baseUnitValue) / 1e-2d,
- SpeedUnit.DecimeterPerMinute => (baseUnitValue * 60) / 1e-1d,
- SpeedUnit.DecimeterPerSecond => (baseUnitValue) / 1e-1d,
- SpeedUnit.FootPerHour => baseUnitValue / 0.3048 * 3600,
- SpeedUnit.FootPerMinute => baseUnitValue / 0.3048 * 60,
- SpeedUnit.FootPerSecond => baseUnitValue / 0.3048,
- SpeedUnit.InchPerHour => (baseUnitValue / 2.54e-2) * 3600,
- SpeedUnit.InchPerMinute => (baseUnitValue / 2.54e-2) * 60,
- SpeedUnit.InchPerSecond => baseUnitValue / 2.54e-2,
- SpeedUnit.KilometerPerHour => (baseUnitValue * 3600) / 1e3d,
- SpeedUnit.KilometerPerMinute => (baseUnitValue * 60) / 1e3d,
- SpeedUnit.KilometerPerSecond => (baseUnitValue) / 1e3d,
- SpeedUnit.Knot => baseUnitValue / (1852.0 / 3600.0),
- SpeedUnit.Mach => baseUnitValue / 340.29,
- SpeedUnit.MeterPerHour => baseUnitValue * 3600,
- SpeedUnit.MeterPerMinute => baseUnitValue * 60,
- SpeedUnit.MeterPerSecond => baseUnitValue,
- SpeedUnit.MicrometerPerMinute => (baseUnitValue * 60) / 1e-6d,
- SpeedUnit.MicrometerPerSecond => (baseUnitValue) / 1e-6d,
- SpeedUnit.MilePerHour => baseUnitValue / 0.44704,
- SpeedUnit.MillimeterPerHour => (baseUnitValue * 3600) / 1e-3d,
- SpeedUnit.MillimeterPerMinute => (baseUnitValue * 60) / 1e-3d,
- SpeedUnit.MillimeterPerSecond => (baseUnitValue) / 1e-3d,
- SpeedUnit.NanometerPerMinute => (baseUnitValue * 60) / 1e-9d,
- SpeedUnit.NanometerPerSecond => (baseUnitValue) / 1e-9d,
- SpeedUnit.UsSurveyFootPerHour => (baseUnitValue * 3937 / 1200) * 3600,
- SpeedUnit.UsSurveyFootPerMinute => (baseUnitValue * 3937 / 1200) * 60,
- SpeedUnit.UsSurveyFootPerSecond => baseUnitValue * 3937 / 1200,
- SpeedUnit.YardPerHour => baseUnitValue / 0.9144 * 3600,
- SpeedUnit.YardPerMinute => baseUnitValue / 0.9144 * 60,
- SpeedUnit.YardPerSecond => baseUnitValue / 0.9144,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(SpeedUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Speed to another Speed with the unit representation .
+ ///
+ /// A Speed with the specified unit.
+ public Speed ToUnit(SpeedUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Speed(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ SpeedUnit.CentimeterPerHour => (_value / 3600) * 1e-2d,
+ SpeedUnit.CentimeterPerMinute => (_value / 60) * 1e-2d,
+ SpeedUnit.CentimeterPerSecond => (_value) * 1e-2d,
+ SpeedUnit.DecimeterPerMinute => (_value / 60) * 1e-1d,
+ SpeedUnit.DecimeterPerSecond => (_value) * 1e-1d,
+ SpeedUnit.FootPerHour => _value * 0.3048 / 3600,
+ SpeedUnit.FootPerMinute => _value * 0.3048 / 60,
+ SpeedUnit.FootPerSecond => _value * 0.3048,
+ SpeedUnit.InchPerHour => (_value / 3600) * 2.54e-2,
+ SpeedUnit.InchPerMinute => (_value / 60) * 2.54e-2,
+ SpeedUnit.InchPerSecond => _value * 2.54e-2,
+ SpeedUnit.KilometerPerHour => (_value / 3600) * 1e3d,
+ SpeedUnit.KilometerPerMinute => (_value / 60) * 1e3d,
+ SpeedUnit.KilometerPerSecond => (_value) * 1e3d,
+ SpeedUnit.Knot => _value * (1852.0 / 3600.0),
+ SpeedUnit.Mach => _value * 340.29,
+ SpeedUnit.MeterPerHour => _value / 3600,
+ SpeedUnit.MeterPerMinute => _value / 60,
+ SpeedUnit.MeterPerSecond => _value,
+ SpeedUnit.MicrometerPerMinute => (_value / 60) * 1e-6d,
+ SpeedUnit.MicrometerPerSecond => (_value) * 1e-6d,
+ SpeedUnit.MilePerHour => _value * 0.44704,
+ SpeedUnit.MillimeterPerHour => (_value / 3600) * 1e-3d,
+ SpeedUnit.MillimeterPerMinute => (_value / 60) * 1e-3d,
+ SpeedUnit.MillimeterPerSecond => (_value) * 1e-3d,
+ SpeedUnit.NanometerPerMinute => (_value / 60) * 1e-9d,
+ SpeedUnit.NanometerPerSecond => (_value) * 1e-9d,
+ SpeedUnit.UsSurveyFootPerHour => (_value * 1200 / 3937) / 3600,
+ SpeedUnit.UsSurveyFootPerMinute => (_value * 1200 / 3937) / 60,
+ SpeedUnit.UsSurveyFootPerSecond => _value * 1200 / 3937,
+ SpeedUnit.YardPerHour => _value * 0.9144 / 3600,
+ SpeedUnit.YardPerMinute => _value * 0.9144 / 60,
+ SpeedUnit.YardPerSecond => _value * 0.9144,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(SpeedUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ SpeedUnit.CentimeterPerHour => (baseUnitValue * 3600) / 1e-2d,
+ SpeedUnit.CentimeterPerMinute => (baseUnitValue * 60) / 1e-2d,
+ SpeedUnit.CentimeterPerSecond => (baseUnitValue) / 1e-2d,
+ SpeedUnit.DecimeterPerMinute => (baseUnitValue * 60) / 1e-1d,
+ SpeedUnit.DecimeterPerSecond => (baseUnitValue) / 1e-1d,
+ SpeedUnit.FootPerHour => baseUnitValue / 0.3048 * 3600,
+ SpeedUnit.FootPerMinute => baseUnitValue / 0.3048 * 60,
+ SpeedUnit.FootPerSecond => baseUnitValue / 0.3048,
+ SpeedUnit.InchPerHour => (baseUnitValue / 2.54e-2) * 3600,
+ SpeedUnit.InchPerMinute => (baseUnitValue / 2.54e-2) * 60,
+ SpeedUnit.InchPerSecond => baseUnitValue / 2.54e-2,
+ SpeedUnit.KilometerPerHour => (baseUnitValue * 3600) / 1e3d,
+ SpeedUnit.KilometerPerMinute => (baseUnitValue * 60) / 1e3d,
+ SpeedUnit.KilometerPerSecond => (baseUnitValue) / 1e3d,
+ SpeedUnit.Knot => baseUnitValue / (1852.0 / 3600.0),
+ SpeedUnit.Mach => baseUnitValue / 340.29,
+ SpeedUnit.MeterPerHour => baseUnitValue * 3600,
+ SpeedUnit.MeterPerMinute => baseUnitValue * 60,
+ SpeedUnit.MeterPerSecond => baseUnitValue,
+ SpeedUnit.MicrometerPerMinute => (baseUnitValue * 60) / 1e-6d,
+ SpeedUnit.MicrometerPerSecond => (baseUnitValue) / 1e-6d,
+ SpeedUnit.MilePerHour => baseUnitValue / 0.44704,
+ SpeedUnit.MillimeterPerHour => (baseUnitValue * 3600) / 1e-3d,
+ SpeedUnit.MillimeterPerMinute => (baseUnitValue * 60) / 1e-3d,
+ SpeedUnit.MillimeterPerSecond => (baseUnitValue) / 1e-3d,
+ SpeedUnit.NanometerPerMinute => (baseUnitValue * 60) / 1e-9d,
+ SpeedUnit.NanometerPerSecond => (baseUnitValue) / 1e-9d,
+ SpeedUnit.UsSurveyFootPerHour => (baseUnitValue * 3937 / 1200) * 3600,
+ SpeedUnit.UsSurveyFootPerMinute => (baseUnitValue * 3937 / 1200) * 60,
+ SpeedUnit.UsSurveyFootPerSecond => baseUnitValue * 3937 / 1200,
+ SpeedUnit.YardPerHour => baseUnitValue / 0.9144 * 3600,
+ SpeedUnit.YardPerMinute => baseUnitValue / 0.9144 * 60,
+ SpeedUnit.YardPerSecond => baseUnitValue / 0.9144,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/StandardVolumeFlow.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/StandardVolumeFlow.g.cs
index 7b87faa2d6..d1666ddb9d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/StandardVolumeFlow.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/StandardVolumeFlow.g.cs
@@ -185,69 +185,69 @@ public static StandardVolumeFlow From(double value, StandardVolumeFlowUnit fromU
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(StandardVolumeFlowUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this StandardVolumeFlow to another StandardVolumeFlow with the unit representation .
- ///
- /// A StandardVolumeFlow with the specified unit.
- public StandardVolumeFlow ToUnit(StandardVolumeFlowUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new StandardVolumeFlow(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute => _value / 6e7,
- StandardVolumeFlowUnit.StandardCubicFootPerHour => _value * 0.028316846592 / 3600,
- StandardVolumeFlowUnit.StandardCubicFootPerMinute => _value * 0.028316846592 / 60,
- StandardVolumeFlowUnit.StandardCubicFootPerSecond => _value * 0.028316846592,
- StandardVolumeFlowUnit.StandardCubicMeterPerDay => _value / 86400,
- StandardVolumeFlowUnit.StandardCubicMeterPerHour => _value / 3600,
- StandardVolumeFlowUnit.StandardCubicMeterPerMinute => _value / 60,
- StandardVolumeFlowUnit.StandardCubicMeterPerSecond => _value,
- StandardVolumeFlowUnit.StandardLiterPerMinute => _value / 60000,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(StandardVolumeFlowUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute => baseUnitValue * 6e7,
- StandardVolumeFlowUnit.StandardCubicFootPerHour => baseUnitValue / (0.028316846592 / 3600),
- StandardVolumeFlowUnit.StandardCubicFootPerMinute => baseUnitValue / (0.028316846592 / 60),
- StandardVolumeFlowUnit.StandardCubicFootPerSecond => baseUnitValue / 0.028316846592,
- StandardVolumeFlowUnit.StandardCubicMeterPerDay => baseUnitValue * 86400,
- StandardVolumeFlowUnit.StandardCubicMeterPerHour => baseUnitValue * 3600,
- StandardVolumeFlowUnit.StandardCubicMeterPerMinute => baseUnitValue * 60,
- StandardVolumeFlowUnit.StandardCubicMeterPerSecond => baseUnitValue,
- StandardVolumeFlowUnit.StandardLiterPerMinute => baseUnitValue * 60000,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(StandardVolumeFlowUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this StandardVolumeFlow to another StandardVolumeFlow with the unit representation .
+ ///
+ /// A StandardVolumeFlow with the specified unit.
+ public StandardVolumeFlow ToUnit(StandardVolumeFlowUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new StandardVolumeFlow(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute => _value / 6e7,
+ StandardVolumeFlowUnit.StandardCubicFootPerHour => _value * 0.028316846592 / 3600,
+ StandardVolumeFlowUnit.StandardCubicFootPerMinute => _value * 0.028316846592 / 60,
+ StandardVolumeFlowUnit.StandardCubicFootPerSecond => _value * 0.028316846592,
+ StandardVolumeFlowUnit.StandardCubicMeterPerDay => _value / 86400,
+ StandardVolumeFlowUnit.StandardCubicMeterPerHour => _value / 3600,
+ StandardVolumeFlowUnit.StandardCubicMeterPerMinute => _value / 60,
+ StandardVolumeFlowUnit.StandardCubicMeterPerSecond => _value,
+ StandardVolumeFlowUnit.StandardLiterPerMinute => _value / 60000,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(StandardVolumeFlowUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ StandardVolumeFlowUnit.StandardCubicCentimeterPerMinute => baseUnitValue * 6e7,
+ StandardVolumeFlowUnit.StandardCubicFootPerHour => baseUnitValue / (0.028316846592 / 3600),
+ StandardVolumeFlowUnit.StandardCubicFootPerMinute => baseUnitValue / (0.028316846592 / 60),
+ StandardVolumeFlowUnit.StandardCubicFootPerSecond => baseUnitValue / 0.028316846592,
+ StandardVolumeFlowUnit.StandardCubicMeterPerDay => baseUnitValue * 86400,
+ StandardVolumeFlowUnit.StandardCubicMeterPerHour => baseUnitValue * 3600,
+ StandardVolumeFlowUnit.StandardCubicMeterPerMinute => baseUnitValue * 60,
+ StandardVolumeFlowUnit.StandardCubicMeterPerSecond => baseUnitValue,
+ StandardVolumeFlowUnit.StandardLiterPerMinute => baseUnitValue * 60000,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Temperature.g.cs
index cc5e7103d4..1715b074dc 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Temperature.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Temperature.g.cs
@@ -195,71 +195,71 @@ public static Temperature From(double value, TemperatureUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(TemperatureUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Temperature to another Temperature with the unit representation .
- ///
- /// A Temperature with the specified unit.
- public Temperature ToUnit(TemperatureUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Temperature(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- TemperatureUnit.DegreeCelsius => _value + 273.15,
- TemperatureUnit.DegreeDelisle => _value * -2 / 3 + 373.15,
- TemperatureUnit.DegreeFahrenheit => _value * 5 / 9 + 459.67 * 5 / 9,
- TemperatureUnit.DegreeNewton => _value * 100 / 33 + 273.15,
- TemperatureUnit.DegreeRankine => _value * 5 / 9,
- TemperatureUnit.DegreeReaumur => _value * 5 / 4 + 273.15,
- TemperatureUnit.DegreeRoemer => _value * 40 / 21 + 273.15 - 7.5 * 40d / 21,
- TemperatureUnit.Kelvin => _value,
- TemperatureUnit.MillidegreeCelsius => _value / 1000 + 273.15,
- TemperatureUnit.SolarTemperature => _value * 5778,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(TemperatureUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- TemperatureUnit.DegreeCelsius => baseUnitValue - 273.15,
- TemperatureUnit.DegreeDelisle => (baseUnitValue - 373.15) * -3 / 2,
- TemperatureUnit.DegreeFahrenheit => (baseUnitValue - 459.67 * 5 / 9) * 9 / 5,
- TemperatureUnit.DegreeNewton => (baseUnitValue - 273.15) * 33 / 100,
- TemperatureUnit.DegreeRankine => baseUnitValue * 9 / 5,
- TemperatureUnit.DegreeReaumur => (baseUnitValue - 273.15) * 4 / 5,
- TemperatureUnit.DegreeRoemer => (baseUnitValue - (273.15 - 7.5 * 40d / 21)) * 21 / 40,
- TemperatureUnit.Kelvin => baseUnitValue,
- TemperatureUnit.MillidegreeCelsius => (baseUnitValue - 273.15) * 1000,
- TemperatureUnit.SolarTemperature => baseUnitValue / 5778,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(TemperatureUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Temperature to another Temperature with the unit representation .
+ ///
+ /// A Temperature with the specified unit.
+ public Temperature ToUnit(TemperatureUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Temperature(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ TemperatureUnit.DegreeCelsius => _value + 273.15,
+ TemperatureUnit.DegreeDelisle => _value * -2 / 3 + 373.15,
+ TemperatureUnit.DegreeFahrenheit => _value * 5 / 9 + 459.67 * 5 / 9,
+ TemperatureUnit.DegreeNewton => _value * 100 / 33 + 273.15,
+ TemperatureUnit.DegreeRankine => _value * 5 / 9,
+ TemperatureUnit.DegreeReaumur => _value * 5 / 4 + 273.15,
+ TemperatureUnit.DegreeRoemer => _value * 40 / 21 + 273.15 - 7.5 * 40d / 21,
+ TemperatureUnit.Kelvin => _value,
+ TemperatureUnit.MillidegreeCelsius => _value / 1000 + 273.15,
+ TemperatureUnit.SolarTemperature => _value * 5778,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(TemperatureUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ TemperatureUnit.DegreeCelsius => baseUnitValue - 273.15,
+ TemperatureUnit.DegreeDelisle => (baseUnitValue - 373.15) * -3 / 2,
+ TemperatureUnit.DegreeFahrenheit => (baseUnitValue - 459.67 * 5 / 9) * 9 / 5,
+ TemperatureUnit.DegreeNewton => (baseUnitValue - 273.15) * 33 / 100,
+ TemperatureUnit.DegreeRankine => baseUnitValue * 9 / 5,
+ TemperatureUnit.DegreeReaumur => (baseUnitValue - 273.15) * 4 / 5,
+ TemperatureUnit.DegreeRoemer => (baseUnitValue - (273.15 - 7.5 * 40d / 21)) * 21 / 40,
+ TemperatureUnit.Kelvin => baseUnitValue,
+ TemperatureUnit.MillidegreeCelsius => (baseUnitValue - 273.15) * 1000,
+ TemperatureUnit.SolarTemperature => baseUnitValue / 5778,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureChangeRate.g.cs
index c2604b1c46..344a1b93a2 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureChangeRate.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureChangeRate.g.cs
@@ -265,85 +265,85 @@ public static TemperatureChangeRate From(double value, TemperatureChangeRateUnit
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(TemperatureChangeRateUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this TemperatureChangeRate to another TemperatureChangeRate with the unit representation .
- ///
- /// A TemperatureChangeRate with the specified unit.
- public TemperatureChangeRate ToUnit(TemperatureChangeRateUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new TemperatureChangeRate(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond => (_value) * 1e-2d,
- TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond => (_value) * 1e1d,
- TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond => (_value) * 1e-1d,
- TemperatureChangeRateUnit.DegreeCelsiusPerHour => _value / 3600,
- TemperatureChangeRateUnit.DegreeCelsiusPerMinute => _value / 60,
- TemperatureChangeRateUnit.DegreeCelsiusPerSecond => _value,
- TemperatureChangeRateUnit.DegreeFahrenheitPerHour => _value * 5 / 9 / 3600,
- TemperatureChangeRateUnit.DegreeFahrenheitPerMinute => _value * 5 / 9 / 60,
- TemperatureChangeRateUnit.DegreeFahrenheitPerSecond => _value * 5 / 9,
- TemperatureChangeRateUnit.DegreeKelvinPerHour => _value / 3600,
- TemperatureChangeRateUnit.DegreeKelvinPerMinute => _value / 60,
- TemperatureChangeRateUnit.DegreeKelvinPerSecond => _value,
- TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond => (_value) * 1e2d,
- TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond => (_value) * 1e3d,
- TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond => (_value) * 1e-6d,
- TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond => (_value) * 1e-3d,
- TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond => (_value) * 1e-9d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(TemperatureChangeRateUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond => (baseUnitValue) / 1e-2d,
- TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond => (baseUnitValue) / 1e1d,
- TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond => (baseUnitValue) / 1e-1d,
- TemperatureChangeRateUnit.DegreeCelsiusPerHour => baseUnitValue * 3600,
- TemperatureChangeRateUnit.DegreeCelsiusPerMinute => baseUnitValue * 60,
- TemperatureChangeRateUnit.DegreeCelsiusPerSecond => baseUnitValue,
- TemperatureChangeRateUnit.DegreeFahrenheitPerHour => baseUnitValue * 9 / 5 * 3600,
- TemperatureChangeRateUnit.DegreeFahrenheitPerMinute => baseUnitValue * 9 / 5 * 60,
- TemperatureChangeRateUnit.DegreeFahrenheitPerSecond => baseUnitValue * 9 / 5,
- TemperatureChangeRateUnit.DegreeKelvinPerHour => baseUnitValue * 3600,
- TemperatureChangeRateUnit.DegreeKelvinPerMinute => baseUnitValue * 60,
- TemperatureChangeRateUnit.DegreeKelvinPerSecond => baseUnitValue,
- TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond => (baseUnitValue) / 1e2d,
- TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond => (baseUnitValue) / 1e3d,
- TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond => (baseUnitValue) / 1e-6d,
- TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond => (baseUnitValue) / 1e-3d,
- TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond => (baseUnitValue) / 1e-9d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(TemperatureChangeRateUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this TemperatureChangeRate to another TemperatureChangeRate with the unit representation .
+ ///
+ /// A TemperatureChangeRate with the specified unit.
+ public TemperatureChangeRate ToUnit(TemperatureChangeRateUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new TemperatureChangeRate(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond => (_value) * 1e-2d,
+ TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond => (_value) * 1e1d,
+ TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond => (_value) * 1e-1d,
+ TemperatureChangeRateUnit.DegreeCelsiusPerHour => _value / 3600,
+ TemperatureChangeRateUnit.DegreeCelsiusPerMinute => _value / 60,
+ TemperatureChangeRateUnit.DegreeCelsiusPerSecond => _value,
+ TemperatureChangeRateUnit.DegreeFahrenheitPerHour => _value * 5 / 9 / 3600,
+ TemperatureChangeRateUnit.DegreeFahrenheitPerMinute => _value * 5 / 9 / 60,
+ TemperatureChangeRateUnit.DegreeFahrenheitPerSecond => _value * 5 / 9,
+ TemperatureChangeRateUnit.DegreeKelvinPerHour => _value / 3600,
+ TemperatureChangeRateUnit.DegreeKelvinPerMinute => _value / 60,
+ TemperatureChangeRateUnit.DegreeKelvinPerSecond => _value,
+ TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond => (_value) * 1e2d,
+ TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond => (_value) * 1e3d,
+ TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond => (_value) * 1e-6d,
+ TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond => (_value) * 1e-3d,
+ TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond => (_value) * 1e-9d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(TemperatureChangeRateUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ TemperatureChangeRateUnit.CentidegreeCelsiusPerSecond => (baseUnitValue) / 1e-2d,
+ TemperatureChangeRateUnit.DecadegreeCelsiusPerSecond => (baseUnitValue) / 1e1d,
+ TemperatureChangeRateUnit.DecidegreeCelsiusPerSecond => (baseUnitValue) / 1e-1d,
+ TemperatureChangeRateUnit.DegreeCelsiusPerHour => baseUnitValue * 3600,
+ TemperatureChangeRateUnit.DegreeCelsiusPerMinute => baseUnitValue * 60,
+ TemperatureChangeRateUnit.DegreeCelsiusPerSecond => baseUnitValue,
+ TemperatureChangeRateUnit.DegreeFahrenheitPerHour => baseUnitValue * 9 / 5 * 3600,
+ TemperatureChangeRateUnit.DegreeFahrenheitPerMinute => baseUnitValue * 9 / 5 * 60,
+ TemperatureChangeRateUnit.DegreeFahrenheitPerSecond => baseUnitValue * 9 / 5,
+ TemperatureChangeRateUnit.DegreeKelvinPerHour => baseUnitValue * 3600,
+ TemperatureChangeRateUnit.DegreeKelvinPerMinute => baseUnitValue * 60,
+ TemperatureChangeRateUnit.DegreeKelvinPerSecond => baseUnitValue,
+ TemperatureChangeRateUnit.HectodegreeCelsiusPerSecond => (baseUnitValue) / 1e2d,
+ TemperatureChangeRateUnit.KilodegreeCelsiusPerSecond => (baseUnitValue) / 1e3d,
+ TemperatureChangeRateUnit.MicrodegreeCelsiusPerSecond => (baseUnitValue) / 1e-6d,
+ TemperatureChangeRateUnit.MillidegreeCelsiusPerSecond => (baseUnitValue) / 1e-3d,
+ TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond => (baseUnitValue) / 1e-9d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureDelta.g.cs
index d167f59008..9f4be5caaa 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureDelta.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureDelta.g.cs
@@ -185,69 +185,69 @@ public static TemperatureDelta From(double value, TemperatureDeltaUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(TemperatureDeltaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this TemperatureDelta to another TemperatureDelta with the unit representation .
- ///
- /// A TemperatureDelta with the specified unit.
- public TemperatureDelta ToUnit(TemperatureDeltaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new TemperatureDelta(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- TemperatureDeltaUnit.DegreeCelsius => _value,
- TemperatureDeltaUnit.DegreeDelisle => _value * -2 / 3,
- TemperatureDeltaUnit.DegreeFahrenheit => _value * 5 / 9,
- TemperatureDeltaUnit.DegreeNewton => _value * 100 / 33,
- TemperatureDeltaUnit.DegreeRankine => _value * 5 / 9,
- TemperatureDeltaUnit.DegreeReaumur => _value * 5 / 4,
- TemperatureDeltaUnit.DegreeRoemer => _value * 40 / 21,
- TemperatureDeltaUnit.Kelvin => _value,
- TemperatureDeltaUnit.MillidegreeCelsius => (_value) * 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(TemperatureDeltaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- TemperatureDeltaUnit.DegreeCelsius => baseUnitValue,
- TemperatureDeltaUnit.DegreeDelisle => baseUnitValue * -3 / 2,
- TemperatureDeltaUnit.DegreeFahrenheit => baseUnitValue * 9 / 5,
- TemperatureDeltaUnit.DegreeNewton => baseUnitValue * 33 / 100,
- TemperatureDeltaUnit.DegreeRankine => baseUnitValue * 9 / 5,
- TemperatureDeltaUnit.DegreeReaumur => baseUnitValue * 4 / 5,
- TemperatureDeltaUnit.DegreeRoemer => baseUnitValue * 21 / 40,
- TemperatureDeltaUnit.Kelvin => baseUnitValue,
- TemperatureDeltaUnit.MillidegreeCelsius => (baseUnitValue) / 1e-3d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(TemperatureDeltaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this TemperatureDelta to another TemperatureDelta with the unit representation .
+ ///
+ /// A TemperatureDelta with the specified unit.
+ public TemperatureDelta ToUnit(TemperatureDeltaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new TemperatureDelta(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ TemperatureDeltaUnit.DegreeCelsius => _value,
+ TemperatureDeltaUnit.DegreeDelisle => _value * -2 / 3,
+ TemperatureDeltaUnit.DegreeFahrenheit => _value * 5 / 9,
+ TemperatureDeltaUnit.DegreeNewton => _value * 100 / 33,
+ TemperatureDeltaUnit.DegreeRankine => _value * 5 / 9,
+ TemperatureDeltaUnit.DegreeReaumur => _value * 5 / 4,
+ TemperatureDeltaUnit.DegreeRoemer => _value * 40 / 21,
+ TemperatureDeltaUnit.Kelvin => _value,
+ TemperatureDeltaUnit.MillidegreeCelsius => (_value) * 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(TemperatureDeltaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ TemperatureDeltaUnit.DegreeCelsius => baseUnitValue,
+ TemperatureDeltaUnit.DegreeDelisle => baseUnitValue * -3 / 2,
+ TemperatureDeltaUnit.DegreeFahrenheit => baseUnitValue * 9 / 5,
+ TemperatureDeltaUnit.DegreeNewton => baseUnitValue * 33 / 100,
+ TemperatureDeltaUnit.DegreeRankine => baseUnitValue * 9 / 5,
+ TemperatureDeltaUnit.DegreeReaumur => baseUnitValue * 4 / 5,
+ TemperatureDeltaUnit.DegreeRoemer => baseUnitValue * 21 / 40,
+ TemperatureDeltaUnit.Kelvin => baseUnitValue,
+ TemperatureDeltaUnit.MillidegreeCelsius => (baseUnitValue) / 1e-3d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs
index 9af36c2657..fe407db1e7 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/TemperatureGradient.g.cs
@@ -135,59 +135,59 @@ public static TemperatureGradient From(double value, TemperatureGradientUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(TemperatureGradientUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this TemperatureGradient to another TemperatureGradient with the unit representation .
- ///
- /// A TemperatureGradient with the specified unit.
- public TemperatureGradient ToUnit(TemperatureGradientUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new TemperatureGradient(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- TemperatureGradientUnit.DegreeCelsiusPerKilometer => _value / 1e3,
- TemperatureGradientUnit.DegreeCelsiusPerMeter => _value,
- TemperatureGradientUnit.DegreeFahrenheitPerFoot => (_value / 0.3048) * 5 / 9,
- TemperatureGradientUnit.KelvinPerMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(TemperatureGradientUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- TemperatureGradientUnit.DegreeCelsiusPerKilometer => baseUnitValue * 1e3,
- TemperatureGradientUnit.DegreeCelsiusPerMeter => baseUnitValue,
- TemperatureGradientUnit.DegreeFahrenheitPerFoot => (baseUnitValue * 0.3048) * 9 / 5,
- TemperatureGradientUnit.KelvinPerMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(TemperatureGradientUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this TemperatureGradient to another TemperatureGradient with the unit representation .
+ ///
+ /// A TemperatureGradient with the specified unit.
+ public TemperatureGradient ToUnit(TemperatureGradientUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new TemperatureGradient(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ TemperatureGradientUnit.DegreeCelsiusPerKilometer => _value / 1e3,
+ TemperatureGradientUnit.DegreeCelsiusPerMeter => _value,
+ TemperatureGradientUnit.DegreeFahrenheitPerFoot => (_value / 0.3048) * 5 / 9,
+ TemperatureGradientUnit.KelvinPerMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(TemperatureGradientUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ TemperatureGradientUnit.DegreeCelsiusPerKilometer => baseUnitValue * 1e3,
+ TemperatureGradientUnit.DegreeCelsiusPerMeter => baseUnitValue,
+ TemperatureGradientUnit.DegreeFahrenheitPerFoot => (baseUnitValue * 0.3048) * 9 / 5,
+ TemperatureGradientUnit.KelvinPerMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalConductivity.g.cs
index 8e5e367335..5622c3c611 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalConductivity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalConductivity.g.cs
@@ -118,55 +118,55 @@ public static ThermalConductivity From(double value, ThermalConductivityUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ThermalConductivityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ThermalConductivity to another ThermalConductivity with the unit representation .
- ///
- /// A ThermalConductivity with the specified unit.
- public ThermalConductivity ToUnit(ThermalConductivityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ThermalConductivity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ThermalConductivityUnit.BtuPerHourFootFahrenheit => _value * ((1055.05585262 / (0.3048 * 3600)) * 1.8),
- ThermalConductivityUnit.WattPerMeterKelvin => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ThermalConductivityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ThermalConductivityUnit.BtuPerHourFootFahrenheit => baseUnitValue / ((1055.05585262 / (0.3048 * 3600)) * 1.8),
- ThermalConductivityUnit.WattPerMeterKelvin => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ThermalConductivityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ThermalConductivity to another ThermalConductivity with the unit representation .
+ ///
+ /// A ThermalConductivity with the specified unit.
+ public ThermalConductivity ToUnit(ThermalConductivityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ThermalConductivity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ThermalConductivityUnit.BtuPerHourFootFahrenheit => _value * ((1055.05585262 / (0.3048 * 3600)) * 1.8),
+ ThermalConductivityUnit.WattPerMeterKelvin => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ThermalConductivityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ThermalConductivityUnit.BtuPerHourFootFahrenheit => baseUnitValue / ((1055.05585262 / (0.3048 * 3600)) * 1.8),
+ ThermalConductivityUnit.WattPerMeterKelvin => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalInsulance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalInsulance.g.cs
index 90ca81b96f..3adf6f7a9b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalInsulance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalInsulance.g.cs
@@ -165,65 +165,65 @@ public static ThermalInsulance From(double value, ThermalInsulanceUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ThermalInsulanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ThermalInsulance to another ThermalInsulance with the unit representation .
- ///
- /// A ThermalInsulance with the specified unit.
- public ThermalInsulance ToUnit(ThermalInsulanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ThermalInsulance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ThermalInsulanceUnit.HourSquareFeetDegreeFahrenheitPerBtu => _value * (1000 * 0.3048 * 0.3048 * 3600) / (1055.05585262 * 1.8),
- ThermalInsulanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie => _value * (0.0001 * 3600) / 4.184,
- ThermalInsulanceUnit.SquareCentimeterKelvinPerWatt => _value * 0.1,
- ThermalInsulanceUnit.SquareMeterDegreeCelsiusPerWatt => _value * 1000.0,
- ThermalInsulanceUnit.SquareMeterKelvinPerKilowatt => _value,
- ThermalInsulanceUnit.SquareMeterKelvinPerWatt => _value * 1000,
- ThermalInsulanceUnit.SquareMillimeterKelvinPerWatt => _value * 0.001,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ThermalInsulanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ThermalInsulanceUnit.HourSquareFeetDegreeFahrenheitPerBtu => baseUnitValue * (1055.05585262 * 1.8) / (1000 * 0.3048 * 0.3048 * 3600),
- ThermalInsulanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie => baseUnitValue * 4.184 / (0.0001 * 3600),
- ThermalInsulanceUnit.SquareCentimeterKelvinPerWatt => baseUnitValue / 0.1,
- ThermalInsulanceUnit.SquareMeterDegreeCelsiusPerWatt => baseUnitValue / 1000.0,
- ThermalInsulanceUnit.SquareMeterKelvinPerKilowatt => baseUnitValue,
- ThermalInsulanceUnit.SquareMeterKelvinPerWatt => baseUnitValue / 1000,
- ThermalInsulanceUnit.SquareMillimeterKelvinPerWatt => baseUnitValue / 0.001,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ThermalInsulanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ThermalInsulance to another ThermalInsulance with the unit representation .
+ ///
+ /// A ThermalInsulance with the specified unit.
+ public ThermalInsulance ToUnit(ThermalInsulanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ThermalInsulance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ThermalInsulanceUnit.HourSquareFeetDegreeFahrenheitPerBtu => _value * (1000 * 0.3048 * 0.3048 * 3600) / (1055.05585262 * 1.8),
+ ThermalInsulanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie => _value * (0.0001 * 3600) / 4.184,
+ ThermalInsulanceUnit.SquareCentimeterKelvinPerWatt => _value * 0.1,
+ ThermalInsulanceUnit.SquareMeterDegreeCelsiusPerWatt => _value * 1000.0,
+ ThermalInsulanceUnit.SquareMeterKelvinPerKilowatt => _value,
+ ThermalInsulanceUnit.SquareMeterKelvinPerWatt => _value * 1000,
+ ThermalInsulanceUnit.SquareMillimeterKelvinPerWatt => _value * 0.001,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ThermalInsulanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ThermalInsulanceUnit.HourSquareFeetDegreeFahrenheitPerBtu => baseUnitValue * (1055.05585262 * 1.8) / (1000 * 0.3048 * 0.3048 * 3600),
+ ThermalInsulanceUnit.SquareCentimeterHourDegreeCelsiusPerKilocalorie => baseUnitValue * 4.184 / (0.0001 * 3600),
+ ThermalInsulanceUnit.SquareCentimeterKelvinPerWatt => baseUnitValue / 0.1,
+ ThermalInsulanceUnit.SquareMeterDegreeCelsiusPerWatt => baseUnitValue / 1000.0,
+ ThermalInsulanceUnit.SquareMeterKelvinPerKilowatt => baseUnitValue,
+ ThermalInsulanceUnit.SquareMeterKelvinPerWatt => baseUnitValue / 1000,
+ ThermalInsulanceUnit.SquareMillimeterKelvinPerWatt => baseUnitValue / 0.001,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalResistance.g.cs
index 017f74e807..7af93ba761 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalResistance.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/ThermalResistance.g.cs
@@ -115,55 +115,55 @@ public static ThermalResistance From(double value, ThermalResistanceUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(ThermalResistanceUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this ThermalResistance to another ThermalResistance with the unit representation .
- ///
- /// A ThermalResistance with the specified unit.
- public ThermalResistance ToUnit(ThermalResistanceUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new ThermalResistance(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- ThermalResistanceUnit.DegreeCelsiusPerWatt => _value,
- ThermalResistanceUnit.KelvinPerWatt => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(ThermalResistanceUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- ThermalResistanceUnit.DegreeCelsiusPerWatt => baseUnitValue,
- ThermalResistanceUnit.KelvinPerWatt => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(ThermalResistanceUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this ThermalResistance to another ThermalResistance with the unit representation .
+ ///
+ /// A ThermalResistance with the specified unit.
+ public ThermalResistance ToUnit(ThermalResistanceUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new ThermalResistance(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ ThermalResistanceUnit.DegreeCelsiusPerWatt => _value,
+ ThermalResistanceUnit.KelvinPerWatt => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(ThermalResistanceUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ ThermalResistanceUnit.DegreeCelsiusPerWatt => baseUnitValue,
+ ThermalResistanceUnit.KelvinPerWatt => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Torque.g.cs
index 07631ceb61..378475eea6 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Torque.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Torque.g.cs
@@ -345,101 +345,101 @@ public static Torque From(double value, TorqueUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(TorqueUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Torque to another Torque with the unit representation .
- ///
- /// A Torque with the specified unit.
- public Torque ToUnit(TorqueUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Torque(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- TorqueUnit.GramForceCentimeter => _value * 9.80665e-5,
- TorqueUnit.GramForceMeter => _value * 9.80665e-3,
- TorqueUnit.GramForceMillimeter => _value * 9.80665e-6,
- TorqueUnit.KilogramForceCentimeter => _value * 9.80665e-2,
- TorqueUnit.KilogramForceMeter => _value * 9.80665,
- TorqueUnit.KilogramForceMillimeter => _value * 9.80665e-3,
- TorqueUnit.KilonewtonCentimeter => (_value * 0.01) * 1e3d,
- TorqueUnit.KilonewtonMeter => (_value) * 1e3d,
- TorqueUnit.KilonewtonMillimeter => (_value * 0.001) * 1e3d,
- TorqueUnit.KilopoundForceFoot => (_value * 4.4482216152605 * 0.3048) * 1e3d,
- TorqueUnit.KilopoundForceInch => (_value * 4.4482216152605 * 2.54e-2) * 1e3d,
- TorqueUnit.MeganewtonCentimeter => (_value * 0.01) * 1e6d,
- TorqueUnit.MeganewtonMeter => (_value) * 1e6d,
- TorqueUnit.MeganewtonMillimeter => (_value * 0.001) * 1e6d,
- TorqueUnit.MegapoundForceFoot => (_value * 4.4482216152605 * 0.3048) * 1e6d,
- TorqueUnit.MegapoundForceInch => (_value * 4.4482216152605 * 2.54e-2) * 1e6d,
- TorqueUnit.NewtonCentimeter => _value * 0.01,
- TorqueUnit.NewtonMeter => _value,
- TorqueUnit.NewtonMillimeter => _value * 0.001,
- TorqueUnit.PoundalFoot => _value * 0.138254954376 * 0.3048,
- TorqueUnit.PoundForceFoot => _value * 4.4482216152605 * 0.3048,
- TorqueUnit.PoundForceInch => _value * 4.4482216152605 * 2.54e-2,
- TorqueUnit.TonneForceCentimeter => _value * 9.80665e1,
- TorqueUnit.TonneForceMeter => _value * 9.80665e3,
- TorqueUnit.TonneForceMillimeter => _value * 9.80665,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(TorqueUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- TorqueUnit.GramForceCentimeter => baseUnitValue / 9.80665e-5,
- TorqueUnit.GramForceMeter => baseUnitValue / 9.80665e-3,
- TorqueUnit.GramForceMillimeter => baseUnitValue / 9.80665e-6,
- TorqueUnit.KilogramForceCentimeter => baseUnitValue / 9.80665e-2,
- TorqueUnit.KilogramForceMeter => baseUnitValue / 9.80665,
- TorqueUnit.KilogramForceMillimeter => baseUnitValue / 9.80665e-3,
- TorqueUnit.KilonewtonCentimeter => (baseUnitValue * 100) / 1e3d,
- TorqueUnit.KilonewtonMeter => (baseUnitValue) / 1e3d,
- TorqueUnit.KilonewtonMillimeter => (baseUnitValue * 1000) / 1e3d,
- TorqueUnit.KilopoundForceFoot => (baseUnitValue / (4.4482216152605 * 0.3048)) / 1e3d,
- TorqueUnit.KilopoundForceInch => (baseUnitValue / (4.4482216152605 * 2.54e-2)) / 1e3d,
- TorqueUnit.MeganewtonCentimeter => (baseUnitValue * 100) / 1e6d,
- TorqueUnit.MeganewtonMeter => (baseUnitValue) / 1e6d,
- TorqueUnit.MeganewtonMillimeter => (baseUnitValue * 1000) / 1e6d,
- TorqueUnit.MegapoundForceFoot => (baseUnitValue / (4.4482216152605 * 0.3048)) / 1e6d,
- TorqueUnit.MegapoundForceInch => (baseUnitValue / (4.4482216152605 * 2.54e-2)) / 1e6d,
- TorqueUnit.NewtonCentimeter => baseUnitValue * 100,
- TorqueUnit.NewtonMeter => baseUnitValue,
- TorqueUnit.NewtonMillimeter => baseUnitValue * 1000,
- TorqueUnit.PoundalFoot => baseUnitValue / (0.138254954376 * 0.3048),
- TorqueUnit.PoundForceFoot => baseUnitValue / (4.4482216152605 * 0.3048),
- TorqueUnit.PoundForceInch => baseUnitValue / (4.4482216152605 * 2.54e-2),
- TorqueUnit.TonneForceCentimeter => baseUnitValue / 9.80665e1,
- TorqueUnit.TonneForceMeter => baseUnitValue / 9.80665e3,
- TorqueUnit.TonneForceMillimeter => baseUnitValue / 9.80665,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(TorqueUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Torque to another Torque with the unit representation .
+ ///
+ /// A Torque with the specified unit.
+ public Torque ToUnit(TorqueUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Torque(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ TorqueUnit.GramForceCentimeter => _value * 9.80665e-5,
+ TorqueUnit.GramForceMeter => _value * 9.80665e-3,
+ TorqueUnit.GramForceMillimeter => _value * 9.80665e-6,
+ TorqueUnit.KilogramForceCentimeter => _value * 9.80665e-2,
+ TorqueUnit.KilogramForceMeter => _value * 9.80665,
+ TorqueUnit.KilogramForceMillimeter => _value * 9.80665e-3,
+ TorqueUnit.KilonewtonCentimeter => (_value * 0.01) * 1e3d,
+ TorqueUnit.KilonewtonMeter => (_value) * 1e3d,
+ TorqueUnit.KilonewtonMillimeter => (_value * 0.001) * 1e3d,
+ TorqueUnit.KilopoundForceFoot => (_value * 4.4482216152605 * 0.3048) * 1e3d,
+ TorqueUnit.KilopoundForceInch => (_value * 4.4482216152605 * 2.54e-2) * 1e3d,
+ TorqueUnit.MeganewtonCentimeter => (_value * 0.01) * 1e6d,
+ TorqueUnit.MeganewtonMeter => (_value) * 1e6d,
+ TorqueUnit.MeganewtonMillimeter => (_value * 0.001) * 1e6d,
+ TorqueUnit.MegapoundForceFoot => (_value * 4.4482216152605 * 0.3048) * 1e6d,
+ TorqueUnit.MegapoundForceInch => (_value * 4.4482216152605 * 2.54e-2) * 1e6d,
+ TorqueUnit.NewtonCentimeter => _value * 0.01,
+ TorqueUnit.NewtonMeter => _value,
+ TorqueUnit.NewtonMillimeter => _value * 0.001,
+ TorqueUnit.PoundalFoot => _value * 0.138254954376 * 0.3048,
+ TorqueUnit.PoundForceFoot => _value * 4.4482216152605 * 0.3048,
+ TorqueUnit.PoundForceInch => _value * 4.4482216152605 * 2.54e-2,
+ TorqueUnit.TonneForceCentimeter => _value * 9.80665e1,
+ TorqueUnit.TonneForceMeter => _value * 9.80665e3,
+ TorqueUnit.TonneForceMillimeter => _value * 9.80665,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(TorqueUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ TorqueUnit.GramForceCentimeter => baseUnitValue / 9.80665e-5,
+ TorqueUnit.GramForceMeter => baseUnitValue / 9.80665e-3,
+ TorqueUnit.GramForceMillimeter => baseUnitValue / 9.80665e-6,
+ TorqueUnit.KilogramForceCentimeter => baseUnitValue / 9.80665e-2,
+ TorqueUnit.KilogramForceMeter => baseUnitValue / 9.80665,
+ TorqueUnit.KilogramForceMillimeter => baseUnitValue / 9.80665e-3,
+ TorqueUnit.KilonewtonCentimeter => (baseUnitValue * 100) / 1e3d,
+ TorqueUnit.KilonewtonMeter => (baseUnitValue) / 1e3d,
+ TorqueUnit.KilonewtonMillimeter => (baseUnitValue * 1000) / 1e3d,
+ TorqueUnit.KilopoundForceFoot => (baseUnitValue / (4.4482216152605 * 0.3048)) / 1e3d,
+ TorqueUnit.KilopoundForceInch => (baseUnitValue / (4.4482216152605 * 2.54e-2)) / 1e3d,
+ TorqueUnit.MeganewtonCentimeter => (baseUnitValue * 100) / 1e6d,
+ TorqueUnit.MeganewtonMeter => (baseUnitValue) / 1e6d,
+ TorqueUnit.MeganewtonMillimeter => (baseUnitValue * 1000) / 1e6d,
+ TorqueUnit.MegapoundForceFoot => (baseUnitValue / (4.4482216152605 * 0.3048)) / 1e6d,
+ TorqueUnit.MegapoundForceInch => (baseUnitValue / (4.4482216152605 * 2.54e-2)) / 1e6d,
+ TorqueUnit.NewtonCentimeter => baseUnitValue * 100,
+ TorqueUnit.NewtonMeter => baseUnitValue,
+ TorqueUnit.NewtonMillimeter => baseUnitValue * 1000,
+ TorqueUnit.PoundalFoot => baseUnitValue / (0.138254954376 * 0.3048),
+ TorqueUnit.PoundForceFoot => baseUnitValue / (4.4482216152605 * 0.3048),
+ TorqueUnit.PoundForceInch => baseUnitValue / (4.4482216152605 * 2.54e-2),
+ TorqueUnit.TonneForceCentimeter => baseUnitValue / 9.80665e1,
+ TorqueUnit.TonneForceMeter => baseUnitValue / 9.80665e3,
+ TorqueUnit.TonneForceMillimeter => baseUnitValue / 9.80665,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Turbidity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Turbidity.g.cs
index 3eef53cc6c..e988c2e66d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Turbidity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Turbidity.g.cs
@@ -108,53 +108,53 @@ public static Turbidity From(double value, TurbidityUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(TurbidityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Turbidity to another Turbidity with the unit representation .
- ///
- /// A Turbidity with the specified unit.
- public Turbidity ToUnit(TurbidityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Turbidity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- TurbidityUnit.NTU => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(TurbidityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- TurbidityUnit.NTU => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(TurbidityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Turbidity to another Turbidity with the unit representation .
+ ///
+ /// A Turbidity with the specified unit.
+ public Turbidity ToUnit(TurbidityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Turbidity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ TurbidityUnit.NTU => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(TurbidityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ TurbidityUnit.NTU => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VitaminA.g.cs
index 3c742f9119..fbc54c2ee2 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VitaminA.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VitaminA.g.cs
@@ -105,53 +105,53 @@ public static VitaminA From(double value, VitaminAUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VitaminAUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this VitaminA to another VitaminA with the unit representation .
- ///
- /// A VitaminA with the specified unit.
- public VitaminA ToUnit(VitaminAUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new VitaminA(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VitaminAUnit.InternationalUnit => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VitaminAUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VitaminAUnit.InternationalUnit => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VitaminAUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this VitaminA to another VitaminA with the unit representation .
+ ///
+ /// A VitaminA with the specified unit.
+ public VitaminA ToUnit(VitaminAUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new VitaminA(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VitaminAUnit.InternationalUnit => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VitaminAUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VitaminAUnit.InternationalUnit => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.g.cs
index 11217d2cf9..ade67859e2 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.g.cs
@@ -645,161 +645,161 @@ public static Volume From(double value, VolumeUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VolumeUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this Volume to another Volume with the unit representation .
- ///
- /// A Volume with the specified unit.
- public Volume ToUnit(VolumeUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new Volume(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VolumeUnit.AcreFoot => _value * 1233.48183754752,
- VolumeUnit.AuTablespoon => _value * 2e-5,
- VolumeUnit.BoardFoot => _value * (0.028316846592 / 12),
- VolumeUnit.Centiliter => (_value / 1e3) * 1e-2d,
- VolumeUnit.CubicCentimeter => _value / 1e6,
- VolumeUnit.CubicDecimeter => _value / 1e3,
- VolumeUnit.CubicFoot => _value * 0.028316846592,
- VolumeUnit.CubicHectometer => _value * 1e6,
- VolumeUnit.CubicInch => _value * 1.6387064e-5,
- VolumeUnit.CubicKilometer => _value * 1e9,
- VolumeUnit.CubicMeter => _value,
- VolumeUnit.CubicMicrometer => _value / 1e18,
- VolumeUnit.CubicMile => _value * 4.168181825440579584e9,
- VolumeUnit.CubicMillimeter => _value / 1e9,
- VolumeUnit.CubicYard => _value * 0.764554857984,
- VolumeUnit.Decaliter => (_value / 1e3) * 1e1d,
- VolumeUnit.DecausGallon => (_value * 0.003785411784) * 1e1d,
- VolumeUnit.Deciliter => (_value / 1e3) * 1e-1d,
- VolumeUnit.DeciusGallon => (_value * 0.003785411784) * 1e-1d,
- VolumeUnit.HectocubicFoot => (_value * 0.028316846592) * 1e2d,
- VolumeUnit.HectocubicMeter => (_value) * 1e2d,
- VolumeUnit.Hectoliter => (_value / 1e3) * 1e2d,
- VolumeUnit.HectousGallon => (_value * 0.003785411784) * 1e2d,
- VolumeUnit.ImperialBeerBarrel => _value * 0.16365924,
- VolumeUnit.ImperialGallon => _value * 0.00454609,
- VolumeUnit.ImperialOunce => _value * 2.84130625e-5,
- VolumeUnit.ImperialPint => _value * 5.6826125e-4,
- VolumeUnit.ImperialQuart => _value * 1.1365225e-3,
- VolumeUnit.KilocubicFoot => (_value * 0.028316846592) * 1e3d,
- VolumeUnit.KilocubicMeter => (_value) * 1e3d,
- VolumeUnit.KiloimperialGallon => (_value * 0.00454609) * 1e3d,
- VolumeUnit.Kiloliter => (_value / 1e3) * 1e3d,
- VolumeUnit.KilousGallon => (_value * 0.003785411784) * 1e3d,
- VolumeUnit.Liter => _value / 1e3,
- VolumeUnit.MegacubicFoot => (_value * 0.028316846592) * 1e6d,
- VolumeUnit.MegaimperialGallon => (_value * 0.00454609) * 1e6d,
- VolumeUnit.Megaliter => (_value / 1e3) * 1e6d,
- VolumeUnit.MegausGallon => (_value * 0.003785411784) * 1e6d,
- VolumeUnit.MetricCup => _value * 0.00025,
- VolumeUnit.MetricTablespoon => _value * 1.5e-5,
- VolumeUnit.MetricTeaspoon => _value * 0.5e-5,
- VolumeUnit.Microliter => (_value / 1e3) * 1e-6d,
- VolumeUnit.Milliliter => (_value / 1e3) * 1e-3d,
- VolumeUnit.Nanoliter => (_value / 1e3) * 1e-9d,
- VolumeUnit.OilBarrel => _value * 0.158987294928,
- VolumeUnit.UkTablespoon => _value * 1.5e-5,
- VolumeUnit.UsBeerBarrel => _value * 0.117347765304,
- VolumeUnit.UsCustomaryCup => _value * 0.0002365882365,
- VolumeUnit.UsGallon => _value * 0.003785411784,
- VolumeUnit.UsLegalCup => _value * 0.00024,
- VolumeUnit.UsOunce => _value * 2.95735295625e-5,
- VolumeUnit.UsPint => _value * 4.73176473e-4,
- VolumeUnit.UsQuart => _value * 9.46352946e-4,
- VolumeUnit.UsTablespoon => _value * 1.478676478125e-5,
- VolumeUnit.UsTeaspoon => _value * 4.92892159375e-6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VolumeUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VolumeUnit.AcreFoot => baseUnitValue / 1233.48183754752,
- VolumeUnit.AuTablespoon => baseUnitValue / 2e-5,
- VolumeUnit.BoardFoot => baseUnitValue / (0.028316846592 / 12),
- VolumeUnit.Centiliter => (baseUnitValue * 1e3) / 1e-2d,
- VolumeUnit.CubicCentimeter => baseUnitValue * 1e6,
- VolumeUnit.CubicDecimeter => baseUnitValue * 1e3,
- VolumeUnit.CubicFoot => baseUnitValue / 0.028316846592,
- VolumeUnit.CubicHectometer => baseUnitValue / 1e6,
- VolumeUnit.CubicInch => baseUnitValue / 1.6387064e-5,
- VolumeUnit.CubicKilometer => baseUnitValue / 1e9,
- VolumeUnit.CubicMeter => baseUnitValue,
- VolumeUnit.CubicMicrometer => baseUnitValue * 1e18,
- VolumeUnit.CubicMile => baseUnitValue / 4.168181825440579584e9,
- VolumeUnit.CubicMillimeter => baseUnitValue * 1e9,
- VolumeUnit.CubicYard => baseUnitValue / 0.764554857984,
- VolumeUnit.Decaliter => (baseUnitValue * 1e3) / 1e1d,
- VolumeUnit.DecausGallon => (baseUnitValue / 0.003785411784) / 1e1d,
- VolumeUnit.Deciliter => (baseUnitValue * 1e3) / 1e-1d,
- VolumeUnit.DeciusGallon => (baseUnitValue / 0.003785411784) / 1e-1d,
- VolumeUnit.HectocubicFoot => (baseUnitValue / 0.028316846592) / 1e2d,
- VolumeUnit.HectocubicMeter => (baseUnitValue) / 1e2d,
- VolumeUnit.Hectoliter => (baseUnitValue * 1e3) / 1e2d,
- VolumeUnit.HectousGallon => (baseUnitValue / 0.003785411784) / 1e2d,
- VolumeUnit.ImperialBeerBarrel => baseUnitValue / 0.16365924,
- VolumeUnit.ImperialGallon => baseUnitValue / 0.00454609,
- VolumeUnit.ImperialOunce => baseUnitValue / 2.84130625e-5,
- VolumeUnit.ImperialPint => baseUnitValue / 5.6826125e-4,
- VolumeUnit.ImperialQuart => baseUnitValue / 1.1365225e-3,
- VolumeUnit.KilocubicFoot => (baseUnitValue / 0.028316846592) / 1e3d,
- VolumeUnit.KilocubicMeter => (baseUnitValue) / 1e3d,
- VolumeUnit.KiloimperialGallon => (baseUnitValue / 0.00454609) / 1e3d,
- VolumeUnit.Kiloliter => (baseUnitValue * 1e3) / 1e3d,
- VolumeUnit.KilousGallon => (baseUnitValue / 0.003785411784) / 1e3d,
- VolumeUnit.Liter => baseUnitValue * 1e3,
- VolumeUnit.MegacubicFoot => (baseUnitValue / 0.028316846592) / 1e6d,
- VolumeUnit.MegaimperialGallon => (baseUnitValue / 0.00454609) / 1e6d,
- VolumeUnit.Megaliter => (baseUnitValue * 1e3) / 1e6d,
- VolumeUnit.MegausGallon => (baseUnitValue / 0.003785411784) / 1e6d,
- VolumeUnit.MetricCup => baseUnitValue / 0.00025,
- VolumeUnit.MetricTablespoon => baseUnitValue / 1.5e-5,
- VolumeUnit.MetricTeaspoon => baseUnitValue / 0.5e-5,
- VolumeUnit.Microliter => (baseUnitValue * 1e3) / 1e-6d,
- VolumeUnit.Milliliter => (baseUnitValue * 1e3) / 1e-3d,
- VolumeUnit.Nanoliter => (baseUnitValue * 1e3) / 1e-9d,
- VolumeUnit.OilBarrel => baseUnitValue / 0.158987294928,
- VolumeUnit.UkTablespoon => baseUnitValue / 1.5e-5,
- VolumeUnit.UsBeerBarrel => baseUnitValue / 0.117347765304,
- VolumeUnit.UsCustomaryCup => baseUnitValue / 0.0002365882365,
- VolumeUnit.UsGallon => baseUnitValue / 0.003785411784,
- VolumeUnit.UsLegalCup => baseUnitValue / 0.00024,
- VolumeUnit.UsOunce => baseUnitValue / 2.95735295625e-5,
- VolumeUnit.UsPint => baseUnitValue / 4.73176473e-4,
- VolumeUnit.UsQuart => baseUnitValue / 9.46352946e-4,
- VolumeUnit.UsTablespoon => baseUnitValue / 1.478676478125e-5,
- VolumeUnit.UsTeaspoon => baseUnitValue / 4.92892159375e-6,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VolumeUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this Volume to another Volume with the unit representation .
+ ///
+ /// A Volume with the specified unit.
+ public Volume ToUnit(VolumeUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new Volume(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VolumeUnit.AcreFoot => _value * 1233.48183754752,
+ VolumeUnit.AuTablespoon => _value * 2e-5,
+ VolumeUnit.BoardFoot => _value * (0.028316846592 / 12),
+ VolumeUnit.Centiliter => (_value / 1e3) * 1e-2d,
+ VolumeUnit.CubicCentimeter => _value / 1e6,
+ VolumeUnit.CubicDecimeter => _value / 1e3,
+ VolumeUnit.CubicFoot => _value * 0.028316846592,
+ VolumeUnit.CubicHectometer => _value * 1e6,
+ VolumeUnit.CubicInch => _value * 1.6387064e-5,
+ VolumeUnit.CubicKilometer => _value * 1e9,
+ VolumeUnit.CubicMeter => _value,
+ VolumeUnit.CubicMicrometer => _value / 1e18,
+ VolumeUnit.CubicMile => _value * 4.168181825440579584e9,
+ VolumeUnit.CubicMillimeter => _value / 1e9,
+ VolumeUnit.CubicYard => _value * 0.764554857984,
+ VolumeUnit.Decaliter => (_value / 1e3) * 1e1d,
+ VolumeUnit.DecausGallon => (_value * 0.003785411784) * 1e1d,
+ VolumeUnit.Deciliter => (_value / 1e3) * 1e-1d,
+ VolumeUnit.DeciusGallon => (_value * 0.003785411784) * 1e-1d,
+ VolumeUnit.HectocubicFoot => (_value * 0.028316846592) * 1e2d,
+ VolumeUnit.HectocubicMeter => (_value) * 1e2d,
+ VolumeUnit.Hectoliter => (_value / 1e3) * 1e2d,
+ VolumeUnit.HectousGallon => (_value * 0.003785411784) * 1e2d,
+ VolumeUnit.ImperialBeerBarrel => _value * 0.16365924,
+ VolumeUnit.ImperialGallon => _value * 0.00454609,
+ VolumeUnit.ImperialOunce => _value * 2.84130625e-5,
+ VolumeUnit.ImperialPint => _value * 5.6826125e-4,
+ VolumeUnit.ImperialQuart => _value * 1.1365225e-3,
+ VolumeUnit.KilocubicFoot => (_value * 0.028316846592) * 1e3d,
+ VolumeUnit.KilocubicMeter => (_value) * 1e3d,
+ VolumeUnit.KiloimperialGallon => (_value * 0.00454609) * 1e3d,
+ VolumeUnit.Kiloliter => (_value / 1e3) * 1e3d,
+ VolumeUnit.KilousGallon => (_value * 0.003785411784) * 1e3d,
+ VolumeUnit.Liter => _value / 1e3,
+ VolumeUnit.MegacubicFoot => (_value * 0.028316846592) * 1e6d,
+ VolumeUnit.MegaimperialGallon => (_value * 0.00454609) * 1e6d,
+ VolumeUnit.Megaliter => (_value / 1e3) * 1e6d,
+ VolumeUnit.MegausGallon => (_value * 0.003785411784) * 1e6d,
+ VolumeUnit.MetricCup => _value * 0.00025,
+ VolumeUnit.MetricTablespoon => _value * 1.5e-5,
+ VolumeUnit.MetricTeaspoon => _value * 0.5e-5,
+ VolumeUnit.Microliter => (_value / 1e3) * 1e-6d,
+ VolumeUnit.Milliliter => (_value / 1e3) * 1e-3d,
+ VolumeUnit.Nanoliter => (_value / 1e3) * 1e-9d,
+ VolumeUnit.OilBarrel => _value * 0.158987294928,
+ VolumeUnit.UkTablespoon => _value * 1.5e-5,
+ VolumeUnit.UsBeerBarrel => _value * 0.117347765304,
+ VolumeUnit.UsCustomaryCup => _value * 0.0002365882365,
+ VolumeUnit.UsGallon => _value * 0.003785411784,
+ VolumeUnit.UsLegalCup => _value * 0.00024,
+ VolumeUnit.UsOunce => _value * 2.95735295625e-5,
+ VolumeUnit.UsPint => _value * 4.73176473e-4,
+ VolumeUnit.UsQuart => _value * 9.46352946e-4,
+ VolumeUnit.UsTablespoon => _value * 1.478676478125e-5,
+ VolumeUnit.UsTeaspoon => _value * 4.92892159375e-6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VolumeUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VolumeUnit.AcreFoot => baseUnitValue / 1233.48183754752,
+ VolumeUnit.AuTablespoon => baseUnitValue / 2e-5,
+ VolumeUnit.BoardFoot => baseUnitValue / (0.028316846592 / 12),
+ VolumeUnit.Centiliter => (baseUnitValue * 1e3) / 1e-2d,
+ VolumeUnit.CubicCentimeter => baseUnitValue * 1e6,
+ VolumeUnit.CubicDecimeter => baseUnitValue * 1e3,
+ VolumeUnit.CubicFoot => baseUnitValue / 0.028316846592,
+ VolumeUnit.CubicHectometer => baseUnitValue / 1e6,
+ VolumeUnit.CubicInch => baseUnitValue / 1.6387064e-5,
+ VolumeUnit.CubicKilometer => baseUnitValue / 1e9,
+ VolumeUnit.CubicMeter => baseUnitValue,
+ VolumeUnit.CubicMicrometer => baseUnitValue * 1e18,
+ VolumeUnit.CubicMile => baseUnitValue / 4.168181825440579584e9,
+ VolumeUnit.CubicMillimeter => baseUnitValue * 1e9,
+ VolumeUnit.CubicYard => baseUnitValue / 0.764554857984,
+ VolumeUnit.Decaliter => (baseUnitValue * 1e3) / 1e1d,
+ VolumeUnit.DecausGallon => (baseUnitValue / 0.003785411784) / 1e1d,
+ VolumeUnit.Deciliter => (baseUnitValue * 1e3) / 1e-1d,
+ VolumeUnit.DeciusGallon => (baseUnitValue / 0.003785411784) / 1e-1d,
+ VolumeUnit.HectocubicFoot => (baseUnitValue / 0.028316846592) / 1e2d,
+ VolumeUnit.HectocubicMeter => (baseUnitValue) / 1e2d,
+ VolumeUnit.Hectoliter => (baseUnitValue * 1e3) / 1e2d,
+ VolumeUnit.HectousGallon => (baseUnitValue / 0.003785411784) / 1e2d,
+ VolumeUnit.ImperialBeerBarrel => baseUnitValue / 0.16365924,
+ VolumeUnit.ImperialGallon => baseUnitValue / 0.00454609,
+ VolumeUnit.ImperialOunce => baseUnitValue / 2.84130625e-5,
+ VolumeUnit.ImperialPint => baseUnitValue / 5.6826125e-4,
+ VolumeUnit.ImperialQuart => baseUnitValue / 1.1365225e-3,
+ VolumeUnit.KilocubicFoot => (baseUnitValue / 0.028316846592) / 1e3d,
+ VolumeUnit.KilocubicMeter => (baseUnitValue) / 1e3d,
+ VolumeUnit.KiloimperialGallon => (baseUnitValue / 0.00454609) / 1e3d,
+ VolumeUnit.Kiloliter => (baseUnitValue * 1e3) / 1e3d,
+ VolumeUnit.KilousGallon => (baseUnitValue / 0.003785411784) / 1e3d,
+ VolumeUnit.Liter => baseUnitValue * 1e3,
+ VolumeUnit.MegacubicFoot => (baseUnitValue / 0.028316846592) / 1e6d,
+ VolumeUnit.MegaimperialGallon => (baseUnitValue / 0.00454609) / 1e6d,
+ VolumeUnit.Megaliter => (baseUnitValue * 1e3) / 1e6d,
+ VolumeUnit.MegausGallon => (baseUnitValue / 0.003785411784) / 1e6d,
+ VolumeUnit.MetricCup => baseUnitValue / 0.00025,
+ VolumeUnit.MetricTablespoon => baseUnitValue / 1.5e-5,
+ VolumeUnit.MetricTeaspoon => baseUnitValue / 0.5e-5,
+ VolumeUnit.Microliter => (baseUnitValue * 1e3) / 1e-6d,
+ VolumeUnit.Milliliter => (baseUnitValue * 1e3) / 1e-3d,
+ VolumeUnit.Nanoliter => (baseUnitValue * 1e3) / 1e-9d,
+ VolumeUnit.OilBarrel => baseUnitValue / 0.158987294928,
+ VolumeUnit.UkTablespoon => baseUnitValue / 1.5e-5,
+ VolumeUnit.UsBeerBarrel => baseUnitValue / 0.117347765304,
+ VolumeUnit.UsCustomaryCup => baseUnitValue / 0.0002365882365,
+ VolumeUnit.UsGallon => baseUnitValue / 0.003785411784,
+ VolumeUnit.UsLegalCup => baseUnitValue / 0.00024,
+ VolumeUnit.UsOunce => baseUnitValue / 2.95735295625e-5,
+ VolumeUnit.UsPint => baseUnitValue / 4.73176473e-4,
+ VolumeUnit.UsQuart => baseUnitValue / 9.46352946e-4,
+ VolumeUnit.UsTablespoon => baseUnitValue / 1.478676478125e-5,
+ VolumeUnit.UsTeaspoon => baseUnitValue / 4.92892159375e-6,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeConcentration.g.cs
index cd2516f36d..cb2a61b861 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeConcentration.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeConcentration.g.cs
@@ -298,91 +298,91 @@ public static VolumeConcentration From(double value, VolumeConcentrationUnit fro
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VolumeConcentrationUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this VolumeConcentration to another VolumeConcentration with the unit representation .
- ///
- /// A VolumeConcentration with the specified unit.
- public VolumeConcentration ToUnit(VolumeConcentrationUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new VolumeConcentration(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VolumeConcentrationUnit.CentiliterPerLiter => (_value) * 1e-2d,
- VolumeConcentrationUnit.CentiliterPerMilliliter => (_value / 1e-3) * 1e-2d,
- VolumeConcentrationUnit.DeciliterPerLiter => (_value) * 1e-1d,
- VolumeConcentrationUnit.DeciliterPerMilliliter => (_value / 1e-3) * 1e-1d,
- VolumeConcentrationUnit.DecimalFraction => _value,
- VolumeConcentrationUnit.LiterPerLiter => _value,
- VolumeConcentrationUnit.LiterPerMilliliter => _value / 1e-3,
- VolumeConcentrationUnit.MicroliterPerLiter => (_value) * 1e-6d,
- VolumeConcentrationUnit.MicroliterPerMilliliter => (_value / 1e-3) * 1e-6d,
- VolumeConcentrationUnit.MilliliterPerLiter => (_value) * 1e-3d,
- VolumeConcentrationUnit.MilliliterPerMilliliter => (_value / 1e-3) * 1e-3d,
- VolumeConcentrationUnit.NanoliterPerLiter => (_value) * 1e-9d,
- VolumeConcentrationUnit.NanoliterPerMilliliter => (_value / 1e-3) * 1e-9d,
- VolumeConcentrationUnit.PartPerBillion => _value / 1e9,
- VolumeConcentrationUnit.PartPerMillion => _value / 1e6,
- VolumeConcentrationUnit.PartPerThousand => _value / 1e3,
- VolumeConcentrationUnit.PartPerTrillion => _value / 1e12,
- VolumeConcentrationUnit.Percent => _value / 1e2,
- VolumeConcentrationUnit.PicoliterPerLiter => (_value) * 1e-12d,
- VolumeConcentrationUnit.PicoliterPerMilliliter => (_value / 1e-3) * 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VolumeConcentrationUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VolumeConcentrationUnit.CentiliterPerLiter => (baseUnitValue) / 1e-2d,
- VolumeConcentrationUnit.CentiliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-2d,
- VolumeConcentrationUnit.DeciliterPerLiter => (baseUnitValue) / 1e-1d,
- VolumeConcentrationUnit.DeciliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-1d,
- VolumeConcentrationUnit.DecimalFraction => baseUnitValue,
- VolumeConcentrationUnit.LiterPerLiter => baseUnitValue,
- VolumeConcentrationUnit.LiterPerMilliliter => baseUnitValue * 1e-3,
- VolumeConcentrationUnit.MicroliterPerLiter => (baseUnitValue) / 1e-6d,
- VolumeConcentrationUnit.MicroliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-6d,
- VolumeConcentrationUnit.MilliliterPerLiter => (baseUnitValue) / 1e-3d,
- VolumeConcentrationUnit.MilliliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-3d,
- VolumeConcentrationUnit.NanoliterPerLiter => (baseUnitValue) / 1e-9d,
- VolumeConcentrationUnit.NanoliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-9d,
- VolumeConcentrationUnit.PartPerBillion => baseUnitValue * 1e9,
- VolumeConcentrationUnit.PartPerMillion => baseUnitValue * 1e6,
- VolumeConcentrationUnit.PartPerThousand => baseUnitValue * 1e3,
- VolumeConcentrationUnit.PartPerTrillion => baseUnitValue * 1e12,
- VolumeConcentrationUnit.Percent => baseUnitValue * 1e2,
- VolumeConcentrationUnit.PicoliterPerLiter => (baseUnitValue) / 1e-12d,
- VolumeConcentrationUnit.PicoliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-12d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VolumeConcentrationUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this VolumeConcentration to another VolumeConcentration with the unit representation .
+ ///
+ /// A VolumeConcentration with the specified unit.
+ public VolumeConcentration ToUnit(VolumeConcentrationUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new VolumeConcentration(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VolumeConcentrationUnit.CentiliterPerLiter => (_value) * 1e-2d,
+ VolumeConcentrationUnit.CentiliterPerMilliliter => (_value / 1e-3) * 1e-2d,
+ VolumeConcentrationUnit.DeciliterPerLiter => (_value) * 1e-1d,
+ VolumeConcentrationUnit.DeciliterPerMilliliter => (_value / 1e-3) * 1e-1d,
+ VolumeConcentrationUnit.DecimalFraction => _value,
+ VolumeConcentrationUnit.LiterPerLiter => _value,
+ VolumeConcentrationUnit.LiterPerMilliliter => _value / 1e-3,
+ VolumeConcentrationUnit.MicroliterPerLiter => (_value) * 1e-6d,
+ VolumeConcentrationUnit.MicroliterPerMilliliter => (_value / 1e-3) * 1e-6d,
+ VolumeConcentrationUnit.MilliliterPerLiter => (_value) * 1e-3d,
+ VolumeConcentrationUnit.MilliliterPerMilliliter => (_value / 1e-3) * 1e-3d,
+ VolumeConcentrationUnit.NanoliterPerLiter => (_value) * 1e-9d,
+ VolumeConcentrationUnit.NanoliterPerMilliliter => (_value / 1e-3) * 1e-9d,
+ VolumeConcentrationUnit.PartPerBillion => _value / 1e9,
+ VolumeConcentrationUnit.PartPerMillion => _value / 1e6,
+ VolumeConcentrationUnit.PartPerThousand => _value / 1e3,
+ VolumeConcentrationUnit.PartPerTrillion => _value / 1e12,
+ VolumeConcentrationUnit.Percent => _value / 1e2,
+ VolumeConcentrationUnit.PicoliterPerLiter => (_value) * 1e-12d,
+ VolumeConcentrationUnit.PicoliterPerMilliliter => (_value / 1e-3) * 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VolumeConcentrationUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VolumeConcentrationUnit.CentiliterPerLiter => (baseUnitValue) / 1e-2d,
+ VolumeConcentrationUnit.CentiliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-2d,
+ VolumeConcentrationUnit.DeciliterPerLiter => (baseUnitValue) / 1e-1d,
+ VolumeConcentrationUnit.DeciliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-1d,
+ VolumeConcentrationUnit.DecimalFraction => baseUnitValue,
+ VolumeConcentrationUnit.LiterPerLiter => baseUnitValue,
+ VolumeConcentrationUnit.LiterPerMilliliter => baseUnitValue * 1e-3,
+ VolumeConcentrationUnit.MicroliterPerLiter => (baseUnitValue) / 1e-6d,
+ VolumeConcentrationUnit.MicroliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-6d,
+ VolumeConcentrationUnit.MilliliterPerLiter => (baseUnitValue) / 1e-3d,
+ VolumeConcentrationUnit.MilliliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-3d,
+ VolumeConcentrationUnit.NanoliterPerLiter => (baseUnitValue) / 1e-9d,
+ VolumeConcentrationUnit.NanoliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-9d,
+ VolumeConcentrationUnit.PartPerBillion => baseUnitValue * 1e9,
+ VolumeConcentrationUnit.PartPerMillion => baseUnitValue * 1e6,
+ VolumeConcentrationUnit.PartPerThousand => baseUnitValue * 1e3,
+ VolumeConcentrationUnit.PartPerTrillion => baseUnitValue * 1e12,
+ VolumeConcentrationUnit.Percent => baseUnitValue * 1e2,
+ VolumeConcentrationUnit.PicoliterPerLiter => (baseUnitValue) / 1e-12d,
+ VolumeConcentrationUnit.PicoliterPerMilliliter => (baseUnitValue * 1e-3) / 1e-12d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlow.g.cs
index 4fdde0e38d..02a0bea36d 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlow.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlow.g.cs
@@ -845,201 +845,201 @@ public static VolumeFlow From(double value, VolumeFlowUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VolumeFlowUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this VolumeFlow to another VolumeFlow with the unit representation .
- ///
- /// A VolumeFlow with the specified unit.
- public VolumeFlow ToUnit(VolumeFlowUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new VolumeFlow(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VolumeFlowUnit.AcreFootPerDay => _value * 1233.48183754752 / 86400,
- VolumeFlowUnit.AcreFootPerHour => _value * 1233.48183754752 / 3600,
- VolumeFlowUnit.AcreFootPerMinute => _value * 1233.48183754752 / 60,
- VolumeFlowUnit.AcreFootPerSecond => _value * 1233.48183754752,
- VolumeFlowUnit.CentiliterPerDay => (_value / (1000 * 86400)) * 1e-2d,
- VolumeFlowUnit.CentiliterPerHour => (_value / (1000 * 3600)) * 1e-2d,
- VolumeFlowUnit.CentiliterPerMinute => (_value / (1000 * 60)) * 1e-2d,
- VolumeFlowUnit.CentiliterPerSecond => (_value / 1000) * 1e-2d,
- VolumeFlowUnit.CubicCentimeterPerMinute => _value * 1e-6 / 60,
- VolumeFlowUnit.CubicDecimeterPerMinute => _value / 60000.00000,
- VolumeFlowUnit.CubicFootPerHour => _value * 0.028316846592 / 3600,
- VolumeFlowUnit.CubicFootPerMinute => _value * 0.028316846592 / 60,
- VolumeFlowUnit.CubicFootPerSecond => _value * 0.028316846592,
- VolumeFlowUnit.CubicMeterPerDay => _value / 86400,
- VolumeFlowUnit.CubicMeterPerHour => _value / 3600,
- VolumeFlowUnit.CubicMeterPerMinute => _value / 60,
- VolumeFlowUnit.CubicMeterPerSecond => _value,
- VolumeFlowUnit.CubicMillimeterPerSecond => _value * 1e-9,
- VolumeFlowUnit.CubicYardPerDay => _value * 0.764554857984 / 86400,
- VolumeFlowUnit.CubicYardPerHour => _value * 0.764554857984 / 3600,
- VolumeFlowUnit.CubicYardPerMinute => _value * 0.764554857984 / 60,
- VolumeFlowUnit.CubicYardPerSecond => _value * 0.764554857984,
- VolumeFlowUnit.DecaliterPerDay => (_value / (1000 * 86400)) * 1e1d,
- VolumeFlowUnit.DecaliterPerHour => (_value / (1000 * 3600)) * 1e1d,
- VolumeFlowUnit.DecaliterPerMinute => (_value / (1000 * 60)) * 1e1d,
- VolumeFlowUnit.DecaliterPerSecond => (_value / 1000) * 1e1d,
- VolumeFlowUnit.DeciliterPerDay => (_value / (1000 * 86400)) * 1e-1d,
- VolumeFlowUnit.DeciliterPerHour => (_value / (1000 * 3600)) * 1e-1d,
- VolumeFlowUnit.DeciliterPerMinute => (_value / (1000 * 60)) * 1e-1d,
- VolumeFlowUnit.DeciliterPerSecond => (_value / 1000) * 1e-1d,
- VolumeFlowUnit.HectoliterPerDay => (_value / (1000 * 86400)) * 1e2d,
- VolumeFlowUnit.HectoliterPerHour => (_value / (1000 * 3600)) * 1e2d,
- VolumeFlowUnit.HectoliterPerMinute => (_value / (1000 * 60)) * 1e2d,
- VolumeFlowUnit.HectoliterPerSecond => (_value / 1000) * 1e2d,
- VolumeFlowUnit.KiloliterPerDay => (_value / (1000 * 86400)) * 1e3d,
- VolumeFlowUnit.KiloliterPerHour => (_value / (1000 * 3600)) * 1e3d,
- VolumeFlowUnit.KiloliterPerMinute => (_value / (1000 * 60)) * 1e3d,
- VolumeFlowUnit.KiloliterPerSecond => (_value / 1000) * 1e3d,
- VolumeFlowUnit.KilousGallonPerMinute => _value * 1000 * 0.003785411784 / 60,
- VolumeFlowUnit.LiterPerDay => _value / (1000 * 86400),
- VolumeFlowUnit.LiterPerHour => _value / (1000 * 3600),
- VolumeFlowUnit.LiterPerMinute => _value / (1000 * 60),
- VolumeFlowUnit.LiterPerSecond => _value / 1000,
- VolumeFlowUnit.MegaliterPerDay => (_value / (1000 * 86400)) * 1e6d,
- VolumeFlowUnit.MegaliterPerHour => (_value / (1000 * 3600)) * 1e6d,
- VolumeFlowUnit.MegaliterPerMinute => (_value / (1000 * 60)) * 1e6d,
- VolumeFlowUnit.MegaliterPerSecond => (_value / 1000) * 1e6d,
- VolumeFlowUnit.MegaukGallonPerDay => (_value * 0.00454609 / 86400) * 1e6d,
- VolumeFlowUnit.MegaukGallonPerSecond => (_value * 0.00454609) * 1e6d,
- VolumeFlowUnit.MegausGallonPerDay => (_value * 0.003785411784 / 86400) * 1e6d,
- VolumeFlowUnit.MicroliterPerDay => (_value / (1000 * 86400)) * 1e-6d,
- VolumeFlowUnit.MicroliterPerHour => (_value / (1000 * 3600)) * 1e-6d,
- VolumeFlowUnit.MicroliterPerMinute => (_value / (1000 * 60)) * 1e-6d,
- VolumeFlowUnit.MicroliterPerSecond => (_value / 1000) * 1e-6d,
- VolumeFlowUnit.MilliliterPerDay => (_value / (1000 * 86400)) * 1e-3d,
- VolumeFlowUnit.MilliliterPerHour => (_value / (1000 * 3600)) * 1e-3d,
- VolumeFlowUnit.MilliliterPerMinute => (_value / (1000 * 60)) * 1e-3d,
- VolumeFlowUnit.MilliliterPerSecond => (_value / 1000) * 1e-3d,
- VolumeFlowUnit.MillionUsGallonPerDay => _value * 1e6 * 0.003785411784 / 86400,
- VolumeFlowUnit.NanoliterPerDay => (_value / (1000 * 86400)) * 1e-9d,
- VolumeFlowUnit.NanoliterPerHour => (_value / (1000 * 3600)) * 1e-9d,
- VolumeFlowUnit.NanoliterPerMinute => (_value / (1000 * 60)) * 1e-9d,
- VolumeFlowUnit.NanoliterPerSecond => (_value / 1000) * 1e-9d,
- VolumeFlowUnit.OilBarrelPerDay => _value * 0.158987294928 / 86400,
- VolumeFlowUnit.OilBarrelPerHour => _value * 0.158987294928 / 3600,
- VolumeFlowUnit.OilBarrelPerMinute => _value * 0.158987294928 / 60,
- VolumeFlowUnit.OilBarrelPerSecond => _value * 0.158987294928,
- VolumeFlowUnit.UkGallonPerDay => _value * 0.00454609 / 86400,
- VolumeFlowUnit.UkGallonPerHour => _value * 0.00454609 / 3600,
- VolumeFlowUnit.UkGallonPerMinute => _value * 0.00454609 / 60,
- VolumeFlowUnit.UkGallonPerSecond => _value * 0.00454609,
- VolumeFlowUnit.UsGallonPerDay => _value * 0.003785411784 / 86400,
- VolumeFlowUnit.UsGallonPerHour => _value * 0.003785411784 / 3600,
- VolumeFlowUnit.UsGallonPerMinute => _value * 0.003785411784 / 60,
- VolumeFlowUnit.UsGallonPerSecond => _value * 0.003785411784,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VolumeFlowUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VolumeFlowUnit.AcreFootPerDay => baseUnitValue / (1233.48183754752 / 86400),
- VolumeFlowUnit.AcreFootPerHour => baseUnitValue / (1233.48183754752 / 3600),
- VolumeFlowUnit.AcreFootPerMinute => baseUnitValue / (1233.48183754752 / 60),
- VolumeFlowUnit.AcreFootPerSecond => baseUnitValue / 1233.48183754752,
- VolumeFlowUnit.CentiliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-2d,
- VolumeFlowUnit.CentiliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-2d,
- VolumeFlowUnit.CentiliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-2d,
- VolumeFlowUnit.CentiliterPerSecond => (baseUnitValue * 1000) / 1e-2d,
- VolumeFlowUnit.CubicCentimeterPerMinute => baseUnitValue / (1e-6 / 60),
- VolumeFlowUnit.CubicDecimeterPerMinute => baseUnitValue * 60000.00000,
- VolumeFlowUnit.CubicFootPerHour => baseUnitValue / (0.028316846592 / 3600),
- VolumeFlowUnit.CubicFootPerMinute => baseUnitValue / (0.028316846592 / 60),
- VolumeFlowUnit.CubicFootPerSecond => baseUnitValue / 0.028316846592,
- VolumeFlowUnit.CubicMeterPerDay => baseUnitValue * 86400,
- VolumeFlowUnit.CubicMeterPerHour => baseUnitValue * 3600,
- VolumeFlowUnit.CubicMeterPerMinute => baseUnitValue * 60,
- VolumeFlowUnit.CubicMeterPerSecond => baseUnitValue,
- VolumeFlowUnit.CubicMillimeterPerSecond => baseUnitValue / 1e-9,
- VolumeFlowUnit.CubicYardPerDay => baseUnitValue / (0.764554857984 / 86400),
- VolumeFlowUnit.CubicYardPerHour => baseUnitValue / (0.764554857984 / 3600),
- VolumeFlowUnit.CubicYardPerMinute => baseUnitValue / (0.764554857984 / 60),
- VolumeFlowUnit.CubicYardPerSecond => baseUnitValue / 0.764554857984,
- VolumeFlowUnit.DecaliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e1d,
- VolumeFlowUnit.DecaliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e1d,
- VolumeFlowUnit.DecaliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e1d,
- VolumeFlowUnit.DecaliterPerSecond => (baseUnitValue * 1000) / 1e1d,
- VolumeFlowUnit.DeciliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-1d,
- VolumeFlowUnit.DeciliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-1d,
- VolumeFlowUnit.DeciliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-1d,
- VolumeFlowUnit.DeciliterPerSecond => (baseUnitValue * 1000) / 1e-1d,
- VolumeFlowUnit.HectoliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e2d,
- VolumeFlowUnit.HectoliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e2d,
- VolumeFlowUnit.HectoliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e2d,
- VolumeFlowUnit.HectoliterPerSecond => (baseUnitValue * 1000) / 1e2d,
- VolumeFlowUnit.KiloliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e3d,
- VolumeFlowUnit.KiloliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e3d,
- VolumeFlowUnit.KiloliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e3d,
- VolumeFlowUnit.KiloliterPerSecond => (baseUnitValue * 1000) / 1e3d,
- VolumeFlowUnit.KilousGallonPerMinute => baseUnitValue / (1000 * 0.003785411784 / 60),
- VolumeFlowUnit.LiterPerDay => baseUnitValue * (1000 * 86400),
- VolumeFlowUnit.LiterPerHour => baseUnitValue * (1000 * 3600),
- VolumeFlowUnit.LiterPerMinute => baseUnitValue * (1000 * 60),
- VolumeFlowUnit.LiterPerSecond => baseUnitValue * 1000,
- VolumeFlowUnit.MegaliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e6d,
- VolumeFlowUnit.MegaliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e6d,
- VolumeFlowUnit.MegaliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e6d,
- VolumeFlowUnit.MegaliterPerSecond => (baseUnitValue * 1000) / 1e6d,
- VolumeFlowUnit.MegaukGallonPerDay => (baseUnitValue / (0.00454609 / 86400)) / 1e6d,
- VolumeFlowUnit.MegaukGallonPerSecond => (baseUnitValue / 0.00454609) / 1e6d,
- VolumeFlowUnit.MegausGallonPerDay => (baseUnitValue / (0.003785411784 / 86400)) / 1e6d,
- VolumeFlowUnit.MicroliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-6d,
- VolumeFlowUnit.MicroliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-6d,
- VolumeFlowUnit.MicroliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-6d,
- VolumeFlowUnit.MicroliterPerSecond => (baseUnitValue * 1000) / 1e-6d,
- VolumeFlowUnit.MilliliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-3d,
- VolumeFlowUnit.MilliliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-3d,
- VolumeFlowUnit.MilliliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-3d,
- VolumeFlowUnit.MilliliterPerSecond => (baseUnitValue * 1000) / 1e-3d,
- VolumeFlowUnit.MillionUsGallonPerDay => baseUnitValue / (1e6 * 0.003785411784 / 86400),
- VolumeFlowUnit.NanoliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-9d,
- VolumeFlowUnit.NanoliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-9d,
- VolumeFlowUnit.NanoliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-9d,
- VolumeFlowUnit.NanoliterPerSecond => (baseUnitValue * 1000) / 1e-9d,
- VolumeFlowUnit.OilBarrelPerDay => baseUnitValue / (0.158987294928 / 86400),
- VolumeFlowUnit.OilBarrelPerHour => baseUnitValue / (0.158987294928 / 3600),
- VolumeFlowUnit.OilBarrelPerMinute => baseUnitValue / (0.158987294928 / 60),
- VolumeFlowUnit.OilBarrelPerSecond => baseUnitValue / 0.158987294928,
- VolumeFlowUnit.UkGallonPerDay => baseUnitValue / (0.00454609 / 86400),
- VolumeFlowUnit.UkGallonPerHour => baseUnitValue / (0.00454609 / 3600),
- VolumeFlowUnit.UkGallonPerMinute => baseUnitValue / (0.00454609 / 60),
- VolumeFlowUnit.UkGallonPerSecond => baseUnitValue / 0.00454609,
- VolumeFlowUnit.UsGallonPerDay => baseUnitValue / (0.003785411784 / 86400),
- VolumeFlowUnit.UsGallonPerHour => baseUnitValue / (0.003785411784 / 3600),
- VolumeFlowUnit.UsGallonPerMinute => baseUnitValue / (0.003785411784 / 60),
- VolumeFlowUnit.UsGallonPerSecond => baseUnitValue / 0.003785411784,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VolumeFlowUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this VolumeFlow to another VolumeFlow with the unit representation .
+ ///
+ /// A VolumeFlow with the specified unit.
+ public VolumeFlow ToUnit(VolumeFlowUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new VolumeFlow(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VolumeFlowUnit.AcreFootPerDay => _value * 1233.48183754752 / 86400,
+ VolumeFlowUnit.AcreFootPerHour => _value * 1233.48183754752 / 3600,
+ VolumeFlowUnit.AcreFootPerMinute => _value * 1233.48183754752 / 60,
+ VolumeFlowUnit.AcreFootPerSecond => _value * 1233.48183754752,
+ VolumeFlowUnit.CentiliterPerDay => (_value / (1000 * 86400)) * 1e-2d,
+ VolumeFlowUnit.CentiliterPerHour => (_value / (1000 * 3600)) * 1e-2d,
+ VolumeFlowUnit.CentiliterPerMinute => (_value / (1000 * 60)) * 1e-2d,
+ VolumeFlowUnit.CentiliterPerSecond => (_value / 1000) * 1e-2d,
+ VolumeFlowUnit.CubicCentimeterPerMinute => _value * 1e-6 / 60,
+ VolumeFlowUnit.CubicDecimeterPerMinute => _value / 60000.00000,
+ VolumeFlowUnit.CubicFootPerHour => _value * 0.028316846592 / 3600,
+ VolumeFlowUnit.CubicFootPerMinute => _value * 0.028316846592 / 60,
+ VolumeFlowUnit.CubicFootPerSecond => _value * 0.028316846592,
+ VolumeFlowUnit.CubicMeterPerDay => _value / 86400,
+ VolumeFlowUnit.CubicMeterPerHour => _value / 3600,
+ VolumeFlowUnit.CubicMeterPerMinute => _value / 60,
+ VolumeFlowUnit.CubicMeterPerSecond => _value,
+ VolumeFlowUnit.CubicMillimeterPerSecond => _value * 1e-9,
+ VolumeFlowUnit.CubicYardPerDay => _value * 0.764554857984 / 86400,
+ VolumeFlowUnit.CubicYardPerHour => _value * 0.764554857984 / 3600,
+ VolumeFlowUnit.CubicYardPerMinute => _value * 0.764554857984 / 60,
+ VolumeFlowUnit.CubicYardPerSecond => _value * 0.764554857984,
+ VolumeFlowUnit.DecaliterPerDay => (_value / (1000 * 86400)) * 1e1d,
+ VolumeFlowUnit.DecaliterPerHour => (_value / (1000 * 3600)) * 1e1d,
+ VolumeFlowUnit.DecaliterPerMinute => (_value / (1000 * 60)) * 1e1d,
+ VolumeFlowUnit.DecaliterPerSecond => (_value / 1000) * 1e1d,
+ VolumeFlowUnit.DeciliterPerDay => (_value / (1000 * 86400)) * 1e-1d,
+ VolumeFlowUnit.DeciliterPerHour => (_value / (1000 * 3600)) * 1e-1d,
+ VolumeFlowUnit.DeciliterPerMinute => (_value / (1000 * 60)) * 1e-1d,
+ VolumeFlowUnit.DeciliterPerSecond => (_value / 1000) * 1e-1d,
+ VolumeFlowUnit.HectoliterPerDay => (_value / (1000 * 86400)) * 1e2d,
+ VolumeFlowUnit.HectoliterPerHour => (_value / (1000 * 3600)) * 1e2d,
+ VolumeFlowUnit.HectoliterPerMinute => (_value / (1000 * 60)) * 1e2d,
+ VolumeFlowUnit.HectoliterPerSecond => (_value / 1000) * 1e2d,
+ VolumeFlowUnit.KiloliterPerDay => (_value / (1000 * 86400)) * 1e3d,
+ VolumeFlowUnit.KiloliterPerHour => (_value / (1000 * 3600)) * 1e3d,
+ VolumeFlowUnit.KiloliterPerMinute => (_value / (1000 * 60)) * 1e3d,
+ VolumeFlowUnit.KiloliterPerSecond => (_value / 1000) * 1e3d,
+ VolumeFlowUnit.KilousGallonPerMinute => _value * 1000 * 0.003785411784 / 60,
+ VolumeFlowUnit.LiterPerDay => _value / (1000 * 86400),
+ VolumeFlowUnit.LiterPerHour => _value / (1000 * 3600),
+ VolumeFlowUnit.LiterPerMinute => _value / (1000 * 60),
+ VolumeFlowUnit.LiterPerSecond => _value / 1000,
+ VolumeFlowUnit.MegaliterPerDay => (_value / (1000 * 86400)) * 1e6d,
+ VolumeFlowUnit.MegaliterPerHour => (_value / (1000 * 3600)) * 1e6d,
+ VolumeFlowUnit.MegaliterPerMinute => (_value / (1000 * 60)) * 1e6d,
+ VolumeFlowUnit.MegaliterPerSecond => (_value / 1000) * 1e6d,
+ VolumeFlowUnit.MegaukGallonPerDay => (_value * 0.00454609 / 86400) * 1e6d,
+ VolumeFlowUnit.MegaukGallonPerSecond => (_value * 0.00454609) * 1e6d,
+ VolumeFlowUnit.MegausGallonPerDay => (_value * 0.003785411784 / 86400) * 1e6d,
+ VolumeFlowUnit.MicroliterPerDay => (_value / (1000 * 86400)) * 1e-6d,
+ VolumeFlowUnit.MicroliterPerHour => (_value / (1000 * 3600)) * 1e-6d,
+ VolumeFlowUnit.MicroliterPerMinute => (_value / (1000 * 60)) * 1e-6d,
+ VolumeFlowUnit.MicroliterPerSecond => (_value / 1000) * 1e-6d,
+ VolumeFlowUnit.MilliliterPerDay => (_value / (1000 * 86400)) * 1e-3d,
+ VolumeFlowUnit.MilliliterPerHour => (_value / (1000 * 3600)) * 1e-3d,
+ VolumeFlowUnit.MilliliterPerMinute => (_value / (1000 * 60)) * 1e-3d,
+ VolumeFlowUnit.MilliliterPerSecond => (_value / 1000) * 1e-3d,
+ VolumeFlowUnit.MillionUsGallonPerDay => _value * 1e6 * 0.003785411784 / 86400,
+ VolumeFlowUnit.NanoliterPerDay => (_value / (1000 * 86400)) * 1e-9d,
+ VolumeFlowUnit.NanoliterPerHour => (_value / (1000 * 3600)) * 1e-9d,
+ VolumeFlowUnit.NanoliterPerMinute => (_value / (1000 * 60)) * 1e-9d,
+ VolumeFlowUnit.NanoliterPerSecond => (_value / 1000) * 1e-9d,
+ VolumeFlowUnit.OilBarrelPerDay => _value * 0.158987294928 / 86400,
+ VolumeFlowUnit.OilBarrelPerHour => _value * 0.158987294928 / 3600,
+ VolumeFlowUnit.OilBarrelPerMinute => _value * 0.158987294928 / 60,
+ VolumeFlowUnit.OilBarrelPerSecond => _value * 0.158987294928,
+ VolumeFlowUnit.UkGallonPerDay => _value * 0.00454609 / 86400,
+ VolumeFlowUnit.UkGallonPerHour => _value * 0.00454609 / 3600,
+ VolumeFlowUnit.UkGallonPerMinute => _value * 0.00454609 / 60,
+ VolumeFlowUnit.UkGallonPerSecond => _value * 0.00454609,
+ VolumeFlowUnit.UsGallonPerDay => _value * 0.003785411784 / 86400,
+ VolumeFlowUnit.UsGallonPerHour => _value * 0.003785411784 / 3600,
+ VolumeFlowUnit.UsGallonPerMinute => _value * 0.003785411784 / 60,
+ VolumeFlowUnit.UsGallonPerSecond => _value * 0.003785411784,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VolumeFlowUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VolumeFlowUnit.AcreFootPerDay => baseUnitValue / (1233.48183754752 / 86400),
+ VolumeFlowUnit.AcreFootPerHour => baseUnitValue / (1233.48183754752 / 3600),
+ VolumeFlowUnit.AcreFootPerMinute => baseUnitValue / (1233.48183754752 / 60),
+ VolumeFlowUnit.AcreFootPerSecond => baseUnitValue / 1233.48183754752,
+ VolumeFlowUnit.CentiliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-2d,
+ VolumeFlowUnit.CentiliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-2d,
+ VolumeFlowUnit.CentiliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-2d,
+ VolumeFlowUnit.CentiliterPerSecond => (baseUnitValue * 1000) / 1e-2d,
+ VolumeFlowUnit.CubicCentimeterPerMinute => baseUnitValue / (1e-6 / 60),
+ VolumeFlowUnit.CubicDecimeterPerMinute => baseUnitValue * 60000.00000,
+ VolumeFlowUnit.CubicFootPerHour => baseUnitValue / (0.028316846592 / 3600),
+ VolumeFlowUnit.CubicFootPerMinute => baseUnitValue / (0.028316846592 / 60),
+ VolumeFlowUnit.CubicFootPerSecond => baseUnitValue / 0.028316846592,
+ VolumeFlowUnit.CubicMeterPerDay => baseUnitValue * 86400,
+ VolumeFlowUnit.CubicMeterPerHour => baseUnitValue * 3600,
+ VolumeFlowUnit.CubicMeterPerMinute => baseUnitValue * 60,
+ VolumeFlowUnit.CubicMeterPerSecond => baseUnitValue,
+ VolumeFlowUnit.CubicMillimeterPerSecond => baseUnitValue / 1e-9,
+ VolumeFlowUnit.CubicYardPerDay => baseUnitValue / (0.764554857984 / 86400),
+ VolumeFlowUnit.CubicYardPerHour => baseUnitValue / (0.764554857984 / 3600),
+ VolumeFlowUnit.CubicYardPerMinute => baseUnitValue / (0.764554857984 / 60),
+ VolumeFlowUnit.CubicYardPerSecond => baseUnitValue / 0.764554857984,
+ VolumeFlowUnit.DecaliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e1d,
+ VolumeFlowUnit.DecaliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e1d,
+ VolumeFlowUnit.DecaliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e1d,
+ VolumeFlowUnit.DecaliterPerSecond => (baseUnitValue * 1000) / 1e1d,
+ VolumeFlowUnit.DeciliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-1d,
+ VolumeFlowUnit.DeciliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-1d,
+ VolumeFlowUnit.DeciliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-1d,
+ VolumeFlowUnit.DeciliterPerSecond => (baseUnitValue * 1000) / 1e-1d,
+ VolumeFlowUnit.HectoliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e2d,
+ VolumeFlowUnit.HectoliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e2d,
+ VolumeFlowUnit.HectoliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e2d,
+ VolumeFlowUnit.HectoliterPerSecond => (baseUnitValue * 1000) / 1e2d,
+ VolumeFlowUnit.KiloliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e3d,
+ VolumeFlowUnit.KiloliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e3d,
+ VolumeFlowUnit.KiloliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e3d,
+ VolumeFlowUnit.KiloliterPerSecond => (baseUnitValue * 1000) / 1e3d,
+ VolumeFlowUnit.KilousGallonPerMinute => baseUnitValue / (1000 * 0.003785411784 / 60),
+ VolumeFlowUnit.LiterPerDay => baseUnitValue * (1000 * 86400),
+ VolumeFlowUnit.LiterPerHour => baseUnitValue * (1000 * 3600),
+ VolumeFlowUnit.LiterPerMinute => baseUnitValue * (1000 * 60),
+ VolumeFlowUnit.LiterPerSecond => baseUnitValue * 1000,
+ VolumeFlowUnit.MegaliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e6d,
+ VolumeFlowUnit.MegaliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e6d,
+ VolumeFlowUnit.MegaliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e6d,
+ VolumeFlowUnit.MegaliterPerSecond => (baseUnitValue * 1000) / 1e6d,
+ VolumeFlowUnit.MegaukGallonPerDay => (baseUnitValue / (0.00454609 / 86400)) / 1e6d,
+ VolumeFlowUnit.MegaukGallonPerSecond => (baseUnitValue / 0.00454609) / 1e6d,
+ VolumeFlowUnit.MegausGallonPerDay => (baseUnitValue / (0.003785411784 / 86400)) / 1e6d,
+ VolumeFlowUnit.MicroliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-6d,
+ VolumeFlowUnit.MicroliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-6d,
+ VolumeFlowUnit.MicroliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-6d,
+ VolumeFlowUnit.MicroliterPerSecond => (baseUnitValue * 1000) / 1e-6d,
+ VolumeFlowUnit.MilliliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-3d,
+ VolumeFlowUnit.MilliliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-3d,
+ VolumeFlowUnit.MilliliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-3d,
+ VolumeFlowUnit.MilliliterPerSecond => (baseUnitValue * 1000) / 1e-3d,
+ VolumeFlowUnit.MillionUsGallonPerDay => baseUnitValue / (1e6 * 0.003785411784 / 86400),
+ VolumeFlowUnit.NanoliterPerDay => (baseUnitValue * (1000 * 86400)) / 1e-9d,
+ VolumeFlowUnit.NanoliterPerHour => (baseUnitValue * (1000 * 3600)) / 1e-9d,
+ VolumeFlowUnit.NanoliterPerMinute => (baseUnitValue * (1000 * 60)) / 1e-9d,
+ VolumeFlowUnit.NanoliterPerSecond => (baseUnitValue * 1000) / 1e-9d,
+ VolumeFlowUnit.OilBarrelPerDay => baseUnitValue / (0.158987294928 / 86400),
+ VolumeFlowUnit.OilBarrelPerHour => baseUnitValue / (0.158987294928 / 3600),
+ VolumeFlowUnit.OilBarrelPerMinute => baseUnitValue / (0.158987294928 / 60),
+ VolumeFlowUnit.OilBarrelPerSecond => baseUnitValue / 0.158987294928,
+ VolumeFlowUnit.UkGallonPerDay => baseUnitValue / (0.00454609 / 86400),
+ VolumeFlowUnit.UkGallonPerHour => baseUnitValue / (0.00454609 / 3600),
+ VolumeFlowUnit.UkGallonPerMinute => baseUnitValue / (0.00454609 / 60),
+ VolumeFlowUnit.UkGallonPerSecond => baseUnitValue / 0.00454609,
+ VolumeFlowUnit.UsGallonPerDay => baseUnitValue / (0.003785411784 / 86400),
+ VolumeFlowUnit.UsGallonPerHour => baseUnitValue / (0.003785411784 / 3600),
+ VolumeFlowUnit.UsGallonPerMinute => baseUnitValue / (0.003785411784 / 60),
+ VolumeFlowUnit.UsGallonPerSecond => baseUnitValue / 0.003785411784,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs
index 1da095f1c0..454a916638 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumeFlowPerArea.g.cs
@@ -115,55 +115,55 @@ public static VolumeFlowPerArea From(double value, VolumeFlowPerAreaUnit fromUni
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VolumeFlowPerAreaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this VolumeFlowPerArea to another VolumeFlowPerArea with the unit representation .
- ///
- /// A VolumeFlowPerArea with the specified unit.
- public VolumeFlowPerArea ToUnit(VolumeFlowPerAreaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new VolumeFlowPerArea(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot => _value * (0.028316846592 / 60) / 9.290304e-2,
- VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter => _value,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VolumeFlowPerAreaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot => baseUnitValue * 9.290304e-2 / (0.028316846592 / 60),
- VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter => baseUnitValue,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VolumeFlowPerAreaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this VolumeFlowPerArea to another VolumeFlowPerArea with the unit representation .
+ ///
+ /// A VolumeFlowPerArea with the specified unit.
+ public VolumeFlowPerArea ToUnit(VolumeFlowPerAreaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new VolumeFlowPerArea(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot => _value * (0.028316846592 / 60) / 9.290304e-2,
+ VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter => _value,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VolumeFlowPerAreaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VolumeFlowPerAreaUnit.CubicFootPerMinutePerSquareFoot => baseUnitValue * 9.290304e-2 / (0.028316846592 / 60),
+ VolumeFlowPerAreaUnit.CubicMeterPerSecondPerSquareMeter => baseUnitValue,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumePerLength.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumePerLength.g.cs
index 5e103e7663..33fb1e54a5 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumePerLength.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumePerLength.g.cs
@@ -185,69 +185,69 @@ public static VolumePerLength From(double value, VolumePerLengthUnit fromUnit)
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VolumePerLengthUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this VolumePerLength to another VolumePerLength with the unit representation .
- ///
- /// A VolumePerLength with the specified unit.
- public VolumePerLength ToUnit(VolumePerLengthUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new VolumePerLength(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VolumePerLengthUnit.CubicMeterPerMeter => _value,
- VolumePerLengthUnit.CubicYardPerFoot => _value * 0.764554857984 / 0.3048,
- VolumePerLengthUnit.CubicYardPerUsSurveyFoot => _value * 0.764554857984 * 3937 / 1200,
- VolumePerLengthUnit.ImperialGallonPerMile => _value * 0.00454609 / 1609.344,
- VolumePerLengthUnit.LiterPerKilometer => _value / 1e6,
- VolumePerLengthUnit.LiterPerMeter => _value / 1000,
- VolumePerLengthUnit.LiterPerMillimeter => _value,
- VolumePerLengthUnit.OilBarrelPerFoot => _value * 0.158987294928 / 0.3048,
- VolumePerLengthUnit.UsGallonPerMile => _value * 0.003785411784 / 1609.344,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VolumePerLengthUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VolumePerLengthUnit.CubicMeterPerMeter => baseUnitValue,
- VolumePerLengthUnit.CubicYardPerFoot => baseUnitValue * 0.3048 / 0.764554857984,
- VolumePerLengthUnit.CubicYardPerUsSurveyFoot => baseUnitValue * 1200 / (0.764554857984 * 3937),
- VolumePerLengthUnit.ImperialGallonPerMile => baseUnitValue * 1609.344 / 0.00454609,
- VolumePerLengthUnit.LiterPerKilometer => baseUnitValue * 1e6,
- VolumePerLengthUnit.LiterPerMeter => baseUnitValue * 1000,
- VolumePerLengthUnit.LiterPerMillimeter => baseUnitValue,
- VolumePerLengthUnit.OilBarrelPerFoot => baseUnitValue * 0.3048 / 0.158987294928,
- VolumePerLengthUnit.UsGallonPerMile => baseUnitValue * 1609.344 / 0.003785411784,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VolumePerLengthUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this VolumePerLength to another VolumePerLength with the unit representation .
+ ///
+ /// A VolumePerLength with the specified unit.
+ public VolumePerLength ToUnit(VolumePerLengthUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new VolumePerLength(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VolumePerLengthUnit.CubicMeterPerMeter => _value,
+ VolumePerLengthUnit.CubicYardPerFoot => _value * 0.764554857984 / 0.3048,
+ VolumePerLengthUnit.CubicYardPerUsSurveyFoot => _value * 0.764554857984 * 3937 / 1200,
+ VolumePerLengthUnit.ImperialGallonPerMile => _value * 0.00454609 / 1609.344,
+ VolumePerLengthUnit.LiterPerKilometer => _value / 1e6,
+ VolumePerLengthUnit.LiterPerMeter => _value / 1000,
+ VolumePerLengthUnit.LiterPerMillimeter => _value,
+ VolumePerLengthUnit.OilBarrelPerFoot => _value * 0.158987294928 / 0.3048,
+ VolumePerLengthUnit.UsGallonPerMile => _value * 0.003785411784 / 1609.344,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VolumePerLengthUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VolumePerLengthUnit.CubicMeterPerMeter => baseUnitValue,
+ VolumePerLengthUnit.CubicYardPerFoot => baseUnitValue * 0.3048 / 0.764554857984,
+ VolumePerLengthUnit.CubicYardPerUsSurveyFoot => baseUnitValue * 1200 / (0.764554857984 * 3937),
+ VolumePerLengthUnit.ImperialGallonPerMile => baseUnitValue * 1609.344 / 0.00454609,
+ VolumePerLengthUnit.LiterPerKilometer => baseUnitValue * 1e6,
+ VolumePerLengthUnit.LiterPerMeter => baseUnitValue * 1000,
+ VolumePerLengthUnit.LiterPerMillimeter => baseUnitValue,
+ VolumePerLengthUnit.OilBarrelPerFoot => baseUnitValue * 0.3048 / 0.158987294928,
+ VolumePerLengthUnit.UsGallonPerMile => baseUnitValue * 1609.344 / 0.003785411784,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs
index 203048c263..62d9d82f9b 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/VolumetricHeatCapacity.g.cs
@@ -188,69 +188,69 @@ public static VolumetricHeatCapacity From(double value, VolumetricHeatCapacityUn
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(VolumetricHeatCapacityUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this VolumetricHeatCapacity to another VolumetricHeatCapacity with the unit representation .
- ///
- /// A VolumetricHeatCapacity with the specified unit.
- public VolumetricHeatCapacity ToUnit(VolumetricHeatCapacityUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new VolumetricHeatCapacity(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit => _value * (1055.05585262 / 0.028316846592) * 1.8,
- VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius => _value * 4.184e6,
- VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius => _value,
- VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin => _value,
- VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius => (_value * 4.184e6) * 1e3d,
- VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius => (_value) * 1e3d,
- VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin => (_value) * 1e3d,
- VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius => (_value) * 1e6d,
- VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin => (_value) * 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(VolumetricHeatCapacityUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit => baseUnitValue / ((1055.05585262 / 0.028316846592) * 1.8),
- VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius => baseUnitValue / 4.184e6,
- VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius => baseUnitValue,
- VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin => baseUnitValue,
- VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius => (baseUnitValue / 4.184e6) / 1e3d,
- VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius => (baseUnitValue) / 1e3d,
- VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin => (baseUnitValue) / 1e3d,
- VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius => (baseUnitValue) / 1e6d,
- VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin => (baseUnitValue) / 1e6d,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(VolumetricHeatCapacityUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this VolumetricHeatCapacity to another VolumetricHeatCapacity with the unit representation .
+ ///
+ /// A VolumetricHeatCapacity with the specified unit.
+ public VolumetricHeatCapacity ToUnit(VolumetricHeatCapacityUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new VolumetricHeatCapacity(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit => _value * (1055.05585262 / 0.028316846592) * 1.8,
+ VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius => _value * 4.184e6,
+ VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius => _value,
+ VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin => _value,
+ VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius => (_value * 4.184e6) * 1e3d,
+ VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius => (_value) * 1e3d,
+ VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin => (_value) * 1e3d,
+ VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius => (_value) * 1e6d,
+ VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin => (_value) * 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(VolumetricHeatCapacityUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ VolumetricHeatCapacityUnit.BtuPerCubicFootDegreeFahrenheit => baseUnitValue / ((1055.05585262 / 0.028316846592) * 1.8),
+ VolumetricHeatCapacityUnit.CaloriePerCubicCentimeterDegreeCelsius => baseUnitValue / 4.184e6,
+ VolumetricHeatCapacityUnit.JoulePerCubicMeterDegreeCelsius => baseUnitValue,
+ VolumetricHeatCapacityUnit.JoulePerCubicMeterKelvin => baseUnitValue,
+ VolumetricHeatCapacityUnit.KilocaloriePerCubicCentimeterDegreeCelsius => (baseUnitValue / 4.184e6) / 1e3d,
+ VolumetricHeatCapacityUnit.KilojoulePerCubicMeterDegreeCelsius => (baseUnitValue) / 1e3d,
+ VolumetricHeatCapacityUnit.KilojoulePerCubicMeterKelvin => (baseUnitValue) / 1e3d,
+ VolumetricHeatCapacityUnit.MegajoulePerCubicMeterDegreeCelsius => (baseUnitValue) / 1e6d,
+ VolumetricHeatCapacityUnit.MegajoulePerCubicMeterKelvin => (baseUnitValue) / 1e6d,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs
index 86f06ab93a..79ec517011 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs
+++ b/UnitsNet.NanoFramework/GeneratedCode/Quantities/WarpingMomentOfInertia.g.cs
@@ -155,63 +155,63 @@ public static WarpingMomentOfInertia From(double value, WarpingMomentOfInertiaUn
#endregion
- #region Conversion Methods
-
- ///
- /// Convert to the unit representation .
- ///
- /// Value converted to the specified unit.
- public double As(WarpingMomentOfInertiaUnit unit) => GetValueAs(unit);
-
- ///
- /// Converts this WarpingMomentOfInertia to another WarpingMomentOfInertia with the unit representation .
- ///
- /// A WarpingMomentOfInertia with the specified unit.
- public WarpingMomentOfInertia ToUnit(WarpingMomentOfInertiaUnit unit)
- {
- var convertedValue = GetValueAs(unit);
- return new WarpingMomentOfInertia(convertedValue, unit);
- }
-
- ///
- /// Converts the current value + unit to the base unit.
- /// This is typically the first step in converting from one unit to another.
- ///
- /// The value in the base unit representation.
- private double GetValueInBaseUnit()
- {
- return Unit switch
- {
- WarpingMomentOfInertiaUnit.CentimeterToTheSixth => _value / 1e12,
- WarpingMomentOfInertiaUnit.DecimeterToTheSixth => _value / 1e6,
- WarpingMomentOfInertiaUnit.FootToTheSixth => _value * 0.000801843800914862014464,
- WarpingMomentOfInertiaUnit.InchToTheSixth => _value * 0.000000000268535866540096,
- WarpingMomentOfInertiaUnit.MeterToTheSixth => _value,
- WarpingMomentOfInertiaUnit.MillimeterToTheSixth => _value / 1e18,
- _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
- };
- }
-
- private double GetValueAs(WarpingMomentOfInertiaUnit unit)
- {
- if (Unit == unit)
- return _value;
-
- var baseUnitValue = GetValueInBaseUnit();
-
- return unit switch
- {
- WarpingMomentOfInertiaUnit.CentimeterToTheSixth => baseUnitValue * 1e12,
- WarpingMomentOfInertiaUnit.DecimeterToTheSixth => baseUnitValue * 1e6,
- WarpingMomentOfInertiaUnit.FootToTheSixth => baseUnitValue / 0.000801843800914862014464,
- WarpingMomentOfInertiaUnit.InchToTheSixth => baseUnitValue / 0.000000000268535866540096,
- WarpingMomentOfInertiaUnit.MeterToTheSixth => baseUnitValue,
- WarpingMomentOfInertiaUnit.MillimeterToTheSixth => baseUnitValue * 1e18,
- _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
- };
- }
-
- #endregion
+ #region Conversion Methods
+
+ ///
+ /// Convert to the unit representation .
+ ///
+ /// Value converted to the specified unit.
+ public double As(WarpingMomentOfInertiaUnit unit) => GetValueAs(unit);
+
+ ///
+ /// Converts this WarpingMomentOfInertia to another WarpingMomentOfInertia with the unit representation .
+ ///
+ /// A WarpingMomentOfInertia with the specified unit.
+ public WarpingMomentOfInertia ToUnit(WarpingMomentOfInertiaUnit unit)
+ {
+ var convertedValue = GetValueAs(unit);
+ return new WarpingMomentOfInertia(convertedValue, unit);
+ }
+
+ ///
+ /// Converts the current value + unit to the base unit.
+ /// This is typically the first step in converting from one unit to another.
+ ///
+ /// The value in the base unit representation.
+ private double GetValueInBaseUnit()
+ {
+ return Unit switch
+ {
+ WarpingMomentOfInertiaUnit.CentimeterToTheSixth => _value / 1e12,
+ WarpingMomentOfInertiaUnit.DecimeterToTheSixth => _value / 1e6,
+ WarpingMomentOfInertiaUnit.FootToTheSixth => _value * 0.000801843800914862014464,
+ WarpingMomentOfInertiaUnit.InchToTheSixth => _value * 0.000000000268535866540096,
+ WarpingMomentOfInertiaUnit.MeterToTheSixth => _value,
+ WarpingMomentOfInertiaUnit.MillimeterToTheSixth => _value / 1e18,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to base units.")
+ };
+ }
+
+ private double GetValueAs(WarpingMomentOfInertiaUnit unit)
+ {
+ if (Unit == unit)
+ return _value;
+
+ var baseUnitValue = GetValueInBaseUnit();
+
+ return unit switch
+ {
+ WarpingMomentOfInertiaUnit.CentimeterToTheSixth => baseUnitValue * 1e12,
+ WarpingMomentOfInertiaUnit.DecimeterToTheSixth => baseUnitValue * 1e6,
+ WarpingMomentOfInertiaUnit.FootToTheSixth => baseUnitValue / 0.000801843800914862014464,
+ WarpingMomentOfInertiaUnit.InchToTheSixth => baseUnitValue / 0.000000000268535866540096,
+ WarpingMomentOfInertiaUnit.MeterToTheSixth => baseUnitValue,
+ WarpingMomentOfInertiaUnit.MillimeterToTheSixth => baseUnitValue * 1e18,
+ _ => throw new NotImplementedException($"Can't convert {Unit} to {unit}.")
+ };
+ }
+
+ #endregion
}
}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/Units/NominalPowerUnit.g.cs b/UnitsNet.NanoFramework/GeneratedCode/Units/NominalPowerUnit.g.cs
new file mode 100644
index 0000000000..3f5fdda950
--- /dev/null
+++ b/UnitsNet.NanoFramework/GeneratedCode/Units/NominalPowerUnit.g.cs
@@ -0,0 +1,44 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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.
+
+// ReSharper disable once CheckNamespace
+namespace UnitsNet.Units
+{
+ // Disable missing XML comment warnings for the generated unit enums.
+ #pragma warning disable 1591
+
+ public enum NominalPowerUnit
+ {
+ DecawattPeak = 1,
+ DeciwattPeak = 2,
+ FemtowattPeak = 3,
+ GigawattPeak = 4,
+ KilowattPeak = 5,
+ MegawattPeak = 6,
+ MicrowattPeak = 7,
+ MilliwattPeak = 8,
+ NanowattPeak = 9,
+ PetawattPeak = 10,
+ PicowattPeak = 11,
+ TerawattPeak = 12,
+ WattPeak = 13,
+ }
+
+ #pragma warning restore 1591
+}
diff --git a/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln b/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
index f2d98d63c4..03dadc92f8 100644
--- a/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
+++ b/UnitsNet.NanoFramework/GeneratedCode/UnitsNet.nanoFramework.sln
@@ -164,6 +164,8 @@ Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Molarity", "Molarity\Molari
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "MolarMass", "MolarMass\MolarMass.nfproj", "{fe51bbda-2039-23fd-f29a-39c14adcb1f6}"
EndProject
+Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "NominalPower", "NominalPower\NominalPower.nfproj", "{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}"
+EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Permeability", "Permeability\Permeability.nfproj", "{34a31e0b-15ec-829c-6f0b-74f5acfd97e2}"
EndProject
Project("{d608a2b1-6ead-4383-a205-ad1ce69d9ef7}") = "Permittivity", "Permittivity\Permittivity.nfproj", "{9b381685-8129-acba-66f0-7068fe43a6c3}"
@@ -750,6 +752,12 @@ Global
{fe51bbda-2039-23fd-f29a-39c14adcb1f6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{fe51bbda-2039-23fd-f29a-39c14adcb1f6}.Release|Any CPU.Build.0 = Release|Any CPU
{fe51bbda-2039-23fd-f29a-39c14adcb1f6}.Release|Any CPU.Deploy.0 = Release|Any CPU
+{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}.Debug|Any CPU.Build.0 = Debug|Any CPU
+{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}.Release|Any CPU.ActiveCfg = Release|Any CPU
+{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}.Release|Any CPU.Build.0 = Release|Any CPU
+{6f14ad52-dce6-4e54-fd46-6ebbe10ac874}.Release|Any CPU.Deploy.0 = Release|Any CPU
{34a31e0b-15ec-829c-6f0b-74f5acfd97e2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34a31e0b-15ec-829c-6f0b-74f5acfd97e2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34a31e0b-15ec-829c-6f0b-74f5acfd97e2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
diff --git a/UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToNominalPowerExtensionsTest.g.cs b/UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToNominalPowerExtensionsTest.g.cs
new file mode 100644
index 0000000000..ed4fdf95ac
--- /dev/null
+++ b/UnitsNet.NumberExtensions.CS14.Tests/GeneratedCode/NumberToNominalPowerExtensionsTest.g.cs
@@ -0,0 +1,80 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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.NumberExtensions.NumberToNominalPower;
+using Xunit;
+
+namespace UnitsNet.Tests
+{
+ public class NumberToNominalPowerExtensionsTests
+ {
+ [Fact]
+ public void NumberToDecawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromDecawattsPeak(2), 2.DecawattsPeak);
+
+ [Fact]
+ public void NumberToDeciwattsPeakTest() =>
+ Assert.Equal(NominalPower.FromDeciwattsPeak(2), 2.DeciwattsPeak);
+
+ [Fact]
+ public void NumberToFemtowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromFemtowattsPeak(2), 2.FemtowattsPeak);
+
+ [Fact]
+ public void NumberToGigawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromGigawattsPeak(2), 2.GigawattsPeak);
+
+ [Fact]
+ public void NumberToKilowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromKilowattsPeak(2), 2.KilowattsPeak);
+
+ [Fact]
+ public void NumberToMegawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromMegawattsPeak(2), 2.MegawattsPeak);
+
+ [Fact]
+ public void NumberToMicrowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromMicrowattsPeak(2), 2.MicrowattsPeak);
+
+ [Fact]
+ public void NumberToMilliwattsPeakTest() =>
+ Assert.Equal(NominalPower.FromMilliwattsPeak(2), 2.MilliwattsPeak);
+
+ [Fact]
+ public void NumberToNanowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromNanowattsPeak(2), 2.NanowattsPeak);
+
+ [Fact]
+ public void NumberToPetawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromPetawattsPeak(2), 2.PetawattsPeak);
+
+ [Fact]
+ public void NumberToPicowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromPicowattsPeak(2), 2.PicowattsPeak);
+
+ [Fact]
+ public void NumberToTerawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromTerawattsPeak(2), 2.TerawattsPeak);
+
+ [Fact]
+ public void NumberToWattsPeakTest() =>
+ Assert.Equal(NominalPower.FromWattsPeak(2), 2.WattsPeak);
+
+ }
+}
diff --git a/UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToNominalPowerExtensions.g.cs b/UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToNominalPowerExtensions.g.cs
new file mode 100644
index 0000000000..0f49dc5e1f
--- /dev/null
+++ b/UnitsNet.NumberExtensions.CS14/GeneratedCode/NumberToNominalPowerExtensions.g.cs
@@ -0,0 +1,151 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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 System;
+
+#if NET7_0_OR_GREATER
+using System.Numerics;
+#endif
+
+#nullable enable
+
+namespace UnitsNet.NumberExtensions.NumberToNominalPower
+{
+ ///
+ /// A number to NominalPower Extensions
+ ///
+ public static class NumberToNominalPowerExtensions
+ {
+#pragma warning disable CS1591
+ extension(T value)
+#pragma warning restore CS1591
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+#else
+ , IConvertible
+#endif
+ {
+ ///
+ public NominalPower DecawattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromDecawattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromDecawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower DeciwattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromDeciwattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromDeciwattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower FemtowattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromFemtowattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromFemtowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower GigawattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromGigawattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromGigawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower KilowattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromKilowattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromKilowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower MegawattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromMegawattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromMegawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower MicrowattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromMicrowattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromMicrowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower MilliwattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromMilliwattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromMilliwattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower NanowattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromNanowattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromNanowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower PetawattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromPetawattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromPetawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower PicowattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromPicowattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromPicowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower TerawattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromTerawattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromTerawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public NominalPower WattsPeak
+#if NET7_0_OR_GREATER
+ => NominalPower.FromWattsPeak(double.CreateChecked(value));
+#else
+ => NominalPower.FromWattsPeak(value.ToDouble(null));
+#endif
+
+ }
+ }
+}
diff --git a/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToNominalPowerExtensionsTest.g.cs b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToNominalPowerExtensionsTest.g.cs
new file mode 100644
index 0000000000..1154c8dfb3
--- /dev/null
+++ b/UnitsNet.NumberExtensions.Tests/GeneratedCode/NumberToNominalPowerExtensionsTest.g.cs
@@ -0,0 +1,80 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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.NumberExtensions.NumberToNominalPower;
+using Xunit;
+
+namespace UnitsNet.Tests
+{
+ public class NumberToNominalPowerExtensionsTests
+ {
+ [Fact]
+ public void NumberToDecawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromDecawattsPeak(2), 2.DecawattsPeak());
+
+ [Fact]
+ public void NumberToDeciwattsPeakTest() =>
+ Assert.Equal(NominalPower.FromDeciwattsPeak(2), 2.DeciwattsPeak());
+
+ [Fact]
+ public void NumberToFemtowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromFemtowattsPeak(2), 2.FemtowattsPeak());
+
+ [Fact]
+ public void NumberToGigawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromGigawattsPeak(2), 2.GigawattsPeak());
+
+ [Fact]
+ public void NumberToKilowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromKilowattsPeak(2), 2.KilowattsPeak());
+
+ [Fact]
+ public void NumberToMegawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromMegawattsPeak(2), 2.MegawattsPeak());
+
+ [Fact]
+ public void NumberToMicrowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromMicrowattsPeak(2), 2.MicrowattsPeak());
+
+ [Fact]
+ public void NumberToMilliwattsPeakTest() =>
+ Assert.Equal(NominalPower.FromMilliwattsPeak(2), 2.MilliwattsPeak());
+
+ [Fact]
+ public void NumberToNanowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromNanowattsPeak(2), 2.NanowattsPeak());
+
+ [Fact]
+ public void NumberToPetawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromPetawattsPeak(2), 2.PetawattsPeak());
+
+ [Fact]
+ public void NumberToPicowattsPeakTest() =>
+ Assert.Equal(NominalPower.FromPicowattsPeak(2), 2.PicowattsPeak());
+
+ [Fact]
+ public void NumberToTerawattsPeakTest() =>
+ Assert.Equal(NominalPower.FromTerawattsPeak(2), 2.TerawattsPeak());
+
+ [Fact]
+ public void NumberToWattsPeakTest() =>
+ Assert.Equal(NominalPower.FromWattsPeak(2), 2.WattsPeak());
+
+ }
+}
diff --git a/UnitsNet.NumberExtensions/GeneratedCode/NumberToNominalPowerExtensions.g.cs b/UnitsNet.NumberExtensions/GeneratedCode/NumberToNominalPowerExtensions.g.cs
new file mode 100644
index 0000000000..7d83c617ef
--- /dev/null
+++ b/UnitsNet.NumberExtensions/GeneratedCode/NumberToNominalPowerExtensions.g.cs
@@ -0,0 +1,179 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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 System;
+
+#if NET7_0_OR_GREATER
+using System.Numerics;
+#endif
+
+#nullable enable
+
+namespace UnitsNet.NumberExtensions.NumberToNominalPower
+{
+ ///
+ /// A number to NominalPower Extensions
+ ///
+ public static class NumberToNominalPowerExtensions
+ {
+ ///
+ public static NominalPower DecawattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromDecawattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromDecawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower DeciwattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromDeciwattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromDeciwattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower FemtowattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromFemtowattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromFemtowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower GigawattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromGigawattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromGigawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower KilowattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromKilowattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromKilowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower MegawattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromMegawattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromMegawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower MicrowattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromMicrowattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromMicrowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower MilliwattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromMilliwattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromMilliwattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower NanowattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromNanowattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromNanowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower PetawattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromPetawattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromPetawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower PicowattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromPicowattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromPicowattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower TerawattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromTerawattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromTerawattsPeak(value.ToDouble(null));
+#endif
+
+ ///
+ public static NominalPower WattsPeak(this T value)
+ where T : notnull
+#if NET7_0_OR_GREATER
+ , INumber
+ => NominalPower.FromWattsPeak(double.CreateChecked(value));
+#else
+ , IConvertible
+ => NominalPower.FromWattsPeak(value.ToDouble(null));
+#endif
+
+ }
+}
diff --git a/UnitsNet.Tests/CustomCode/NominalPowerTests.cs b/UnitsNet.Tests/CustomCode/NominalPowerTests.cs
new file mode 100644
index 0000000000..fdd7e84d50
--- /dev/null
+++ b/UnitsNet.Tests/CustomCode/NominalPowerTests.cs
@@ -0,0 +1,40 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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 System;
+
+namespace UnitsNet.Tests.CustomCode
+{
+ public class NominalPowerTests : NominalPowerTestsBase
+ {
+ protected override double FemtowattsPeakInOneWattPeak => 1e15;
+ protected override double PicowattsPeakInOneWattPeak => 1e12;
+ protected override double NanowattsPeakInOneWattPeak => 1e9;
+ protected override double MicrowattsPeakInOneWattPeak => 1e6;
+ protected override double MilliwattsPeakInOneWattPeak => 1e3;
+ protected override double DeciwattsPeakInOneWattPeak => 1e1;
+ protected override double WattsPeakInOneWattPeak => 1d;
+ protected override double DecawattsPeakInOneWattPeak => 1e-1;
+ protected override double KilowattsPeakInOneWattPeak => 1e-3;
+ protected override double MegawattsPeakInOneWattPeak => 1e-6;
+ protected override double GigawattsPeakInOneWattPeak => 1e-9;
+ protected override double TerawattsPeakInOneWattPeak => 1e-12;
+ protected override double PetawattsPeakInOneWattPeak => 1e-15;
+ }
+}
diff --git a/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs b/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
index 9dfabd182a..3cf543db8c 100644
--- a/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
+++ b/UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs
@@ -115,6 +115,7 @@ void Assertion(int expectedValue, Enum expectedUnit, IQuantity quantity)
Assertion(3, MolarFlowUnit.PoundMolePerSecond, Quantity.From(3, MolarFlowUnit.PoundMolePerSecond));
Assertion(3, MolarityUnit.PoundMolePerCubicFoot, Quantity.From(3, MolarityUnit.PoundMolePerCubicFoot));
Assertion(3, MolarMassUnit.PoundPerMole, Quantity.From(3, MolarMassUnit.PoundPerMole));
+ Assertion(3, NominalPowerUnit.WattPeak, Quantity.From(3, NominalPowerUnit.WattPeak));
Assertion(3, PermeabilityUnit.HenryPerMeter, Quantity.From(3, PermeabilityUnit.HenryPerMeter));
Assertion(3, PermittivityUnit.FaradPerMeter, Quantity.From(3, PermittivityUnit.FaradPerMeter));
Assertion(3, PorousMediumPermeabilityUnit.SquareMeter, Quantity.From(3, PorousMediumPermeabilityUnit.SquareMeter));
@@ -250,6 +251,7 @@ public void QuantityInfo_IsSameAsStaticInfoProperty()
Assertion(MolarFlow.Info, MolarFlow.Zero);
Assertion(Molarity.Info, Molarity.Zero);
Assertion(MolarMass.Info, MolarMass.Zero);
+ Assertion(NominalPower.Info, NominalPower.Zero);
Assertion(Permeability.Info, Permeability.Zero);
Assertion(Permittivity.Info, Permittivity.Zero);
Assertion(PorousMediumPermeability.Info, PorousMediumPermeability.Zero);
diff --git a/UnitsNet.Tests/GeneratedCode/TestsBase/NominalPowerTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/TestsBase/NominalPowerTestsBase.g.cs
new file mode 100644
index 0000000000..3f1f1dd755
--- /dev/null
+++ b/UnitsNet.Tests/GeneratedCode/TestsBase/NominalPowerTestsBase.g.cs
@@ -0,0 +1,936 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by \generate-code.bat.
+//
+// Changes to this file will be lost when the code is regenerated.
+// The build server regenerates the code before each build and a pre-build
+// step will regenerate the code on each local build.
+//
+// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
+//
+// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
+// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
+//
+//
+//------------------------------------------------------------------------------
+
+// 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 System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading;
+using UnitsNet.InternalHelpers;
+using UnitsNet.Tests.Helpers;
+using UnitsNet.Tests.TestsBase;
+using UnitsNet.Units;
+using Xunit;
+
+// Disable build warning CS1718: Comparison made to same variable; did you mean to compare something else?
+#pragma warning disable 1718
+
+// ReSharper disable once CheckNamespace
+namespace UnitsNet.Tests
+{
+ ///
+ /// Test of NominalPower.
+ ///
+// ReSharper disable once PartialTypeWithSinglePart
+ public abstract partial class NominalPowerTestsBase : QuantityTestsBase
+ {
+ protected abstract double DecawattsPeakInOneWattPeak { get; }
+ protected abstract double DeciwattsPeakInOneWattPeak { get; }
+ protected abstract double FemtowattsPeakInOneWattPeak { get; }
+ protected abstract double GigawattsPeakInOneWattPeak { get; }
+ protected abstract double KilowattsPeakInOneWattPeak { get; }
+ protected abstract double MegawattsPeakInOneWattPeak { get; }
+ protected abstract double MicrowattsPeakInOneWattPeak { get; }
+ protected abstract double MilliwattsPeakInOneWattPeak { get; }
+ protected abstract double NanowattsPeakInOneWattPeak { get; }
+ protected abstract double PetawattsPeakInOneWattPeak { get; }
+ protected abstract double PicowattsPeakInOneWattPeak { get; }
+ protected abstract double TerawattsPeakInOneWattPeak { get; }
+ protected abstract double WattsPeakInOneWattPeak { get; }
+
+// ReSharper disable VirtualMemberNeverOverriden.Global
+ protected virtual double DecawattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double DeciwattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double FemtowattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double GigawattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double KilowattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double MegawattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double MicrowattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double MilliwattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double NanowattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double PetawattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double PicowattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double TerawattsPeakTolerance { get { return 1e-5; } }
+ protected virtual double WattsPeakTolerance { get { return 1e-5; } }
+// ReSharper restore VirtualMemberNeverOverriden.Global
+
+ protected (double UnitsInBaseUnit, double Tolerence) GetConversionFactor(NominalPowerUnit unit)
+ {
+ return unit switch
+ {
+ NominalPowerUnit.DecawattPeak => (DecawattsPeakInOneWattPeak, DecawattsPeakTolerance),
+ NominalPowerUnit.DeciwattPeak => (DeciwattsPeakInOneWattPeak, DeciwattsPeakTolerance),
+ NominalPowerUnit.FemtowattPeak => (FemtowattsPeakInOneWattPeak, FemtowattsPeakTolerance),
+ NominalPowerUnit.GigawattPeak => (GigawattsPeakInOneWattPeak, GigawattsPeakTolerance),
+ NominalPowerUnit.KilowattPeak => (KilowattsPeakInOneWattPeak, KilowattsPeakTolerance),
+ NominalPowerUnit.MegawattPeak => (MegawattsPeakInOneWattPeak, MegawattsPeakTolerance),
+ NominalPowerUnit.MicrowattPeak => (MicrowattsPeakInOneWattPeak, MicrowattsPeakTolerance),
+ NominalPowerUnit.MilliwattPeak => (MilliwattsPeakInOneWattPeak, MilliwattsPeakTolerance),
+ NominalPowerUnit.NanowattPeak => (NanowattsPeakInOneWattPeak, NanowattsPeakTolerance),
+ NominalPowerUnit.PetawattPeak => (PetawattsPeakInOneWattPeak, PetawattsPeakTolerance),
+ NominalPowerUnit.PicowattPeak => (PicowattsPeakInOneWattPeak, PicowattsPeakTolerance),
+ NominalPowerUnit.TerawattPeak => (TerawattsPeakInOneWattPeak, TerawattsPeakTolerance),
+ NominalPowerUnit.WattPeak => (WattsPeakInOneWattPeak, WattsPeakTolerance),
+ _ => throw new NotSupportedException()
+ };
+ }
+
+ public static IEnumerable