public void ConversionRoundTrip() { ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1); Assert.AreEqual(1, ElectricPotentialAc.FromKilovoltsAc(voltac.KilovoltsAc).VoltsAc, KilovoltsAcTolerance); Assert.AreEqual(1, ElectricPotentialAc.FromMegavoltsAc(voltac.MegavoltsAc).VoltsAc, MegavoltsAcTolerance); Assert.AreEqual(1, ElectricPotentialAc.FromMicrovoltsAc(voltac.MicrovoltsAc).VoltsAc, MicrovoltsAcTolerance); Assert.AreEqual(1, ElectricPotentialAc.FromMillivoltsAc(voltac.MillivoltsAc).VoltsAc, MillivoltsAcTolerance); Assert.AreEqual(1, ElectricPotentialAc.FromVoltsAc(voltac.VoltsAc).VoltsAc, VoltsAcTolerance); }
public void NumberToMillivoltsAcTest() => Assert.Equal(ElectricPotentialAc.FromMillivoltsAc(2), 2.MillivoltsAc());
/// <inheritdoc cref="ElectricPotentialAc.FromMillivoltsAc(double?)"/> public static ElectricPotentialAc?MillivoltsAc(this decimal?value) => ElectricPotentialAc.FromMillivoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="ElectricPotentialAc.FromMillivoltsAc(double)"/> public static ElectricPotentialAc MillivoltsAc(this decimal value) => ElectricPotentialAc.FromMillivoltsAc(Convert.ToDouble(value));
/// <inheritdoc cref="ElectricPotentialAc.FromMillivoltsAc(double?)"/> public static ElectricPotentialAc?MillivoltsAc(this float?value) => ElectricPotentialAc.FromMillivoltsAc(value);
/// <inheritdoc cref="ElectricPotentialAc.FromMillivoltsAc(double)"/> public static ElectricPotentialAc MillivoltsAc(this double value) => ElectricPotentialAc.FromMillivoltsAc(value);
public static ElectricPotentialAc?MillivoltsAc <T>(this T?value) where T : struct => ElectricPotentialAc.FromMillivoltsAc(value == null ? (double?)null : Convert.ToDouble(value.Value));
public static ElectricPotentialAc MillivoltsAc <T>(this T value) => ElectricPotentialAc.FromMillivoltsAc(Convert.ToDecimal(value));