public static bool TryParseUnit(string str, out PressureChangeRateUnit unit) { return(TryParseUnit(str, null, out unit)); }
/// <summary> /// Get unit abbreviation string. /// </summary> /// <param name="unit">Unit to get abbreviation for.</param> /// <returns>Unit abbreviation string.</returns> /// <param name="cultureName">Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to <see cref="GlobalConfiguration.DefaultCulture" /> if null.</param> public static string GetAbbreviation(PressureChangeRateUnit unit, [CanBeNull] string cultureName) { IFormatProvider provider = GetFormatProviderFromCultureName(cultureName); return(UnitAbbreviationsCache.Default.GetDefaultAbbreviation(unit, provider)); }
public static PressureChangeRate From(double value, PressureChangeRateUnit fromUnit) { return(new PressureChangeRate((double)value, fromUnit)); }
/// <summary> /// Get string representation of value and unit. Using current UI culture and two significant digits after radix. /// </summary> /// <param name="unit">Unit representation to use.</param> /// <returns>String representation.</returns> public string ToString(PressureChangeRateUnit unit) { return(ToString(unit, null, 2)); }
/// <summary> /// Get unit abbreviation string. /// </summary> /// <param name="unit">Unit to get abbreviation for.</param> /// <returns>Unit abbreviation string.</returns> public static string GetAbbreviation(PressureChangeRateUnit unit) { return(GetAbbreviation(unit, null)); }
public static PressureChangeRate From(QuantityValue value, PressureChangeRateUnit fromUnit) #endif { return(new PressureChangeRate((double)value, fromUnit)); }
/// <summary> /// Converts this PressureChangeRate to another PressureChangeRate with the unit representation <paramref name="unit" />. /// </summary> /// <returns>A PressureChangeRate with the specified unit.</returns> public PressureChangeRate ToUnit(PressureChangeRateUnit unit) { var convertedValue = AsBaseNumericType(unit); return(new PressureChangeRate(convertedValue, unit)); }
public static PressureChangeRate From(double value, PressureChangeRateUnit fromUnit)
PressureChangeRate(double numericValue, PressureChangeRateUnit unit) { _value = numericValue; _unit = unit; }
/// <summary> /// Creates the quantity with the given numeric value and unit. /// </summary> /// <param name="value">The numeric value to construct this quantity with.</param> /// <param name="unit">The unit representation to construct this quantity with.</param> /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception> public PressureChangeRate(double value, PressureChangeRateUnit unit) { _value = value; _unit = unit; }
/// <summary> /// Converts this Duration to another Duration with the unit representation <paramref name="unit" />. /// </summary> /// <returns>A Duration with the specified unit.</returns> public PressureChangeRate ToUnit(PressureChangeRateUnit unit) { var convertedValue = GetValueAs(unit); return(new PressureChangeRate(convertedValue, unit)); }
/// <summary> /// Convert to the unit representation <paramref name="unit" />. /// </summary> /// <returns>Value converted to the specified unit.</returns> public double As(PressureChangeRateUnit unit) => GetValueAs(unit);