public void ConversionRoundTrip() { ApparentPower voltampere = ApparentPower.FromVoltamperes(1); AssertEx.EqualTolerance(1, ApparentPower.FromKilovoltamperes(voltampere.Kilovoltamperes).Voltamperes, KilovoltamperesTolerance); AssertEx.EqualTolerance(1, ApparentPower.FromMegavoltamperes(voltampere.Megavoltamperes).Voltamperes, MegavoltamperesTolerance); AssertEx.EqualTolerance(1, ApparentPower.FromVoltamperes(voltampere.Voltamperes).Voltamperes, VoltamperesTolerance); }
/// <inheritdoc cref="ApparentPower.FromMegavoltamperes(UnitsNet.QuantityValue)" /> public static ApparentPower?Megavoltamperes(this decimal?value) => ApparentPower.FromMegavoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="ApparentPower.FromMegavoltamperes(UnitsNet.QuantityValue)" /> public static ApparentPower Megavoltamperes(this decimal value) => ApparentPower.FromMegavoltamperes(Convert.ToDouble(value));
/// <inheritdoc cref="ApparentPower.FromMegavoltamperes(UnitsNet.QuantityValue)" /> public static ApparentPower?Megavoltamperes(this float?value) => ApparentPower.FromMegavoltamperes(value);
/// <inheritdoc cref="ApparentPower.FromMegavoltamperes(UnitsNet.QuantityValue)" /> public static ApparentPower Megavoltamperes(this double value) => ApparentPower.FromMegavoltamperes(value);
public static ApparentPower Megavoltamperes <T>(this T value) => ApparentPower.FromMegavoltamperes(Convert.ToDecimal(value));
public void NumberToMegavoltamperesTest() => Assert.Equal(ApparentPower.FromMegavoltamperes(2), 2.Megavoltamperes());
public static ApparentPower?Megavoltamperes <T>(this T?value) where T : struct => ApparentPower.FromMegavoltamperes(value == null ? (double?)null : Convert.ToDouble(value.Value));