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