public static string DspString(double Value, PressureRateUnit Unit) { if (double.IsNaN(Value)) { return(""); } return(Value.ToString(mDspFmt[(int)Unit], CultureInfo.CurrentCulture)); }
public static string LogString(double Value, PressureRateUnit Unit, CultureInfo Culture) { if (double.IsNaN(Value)) { return(""); } return(Value.ToString(mLogFmt[(int)Unit], Culture)); }
public static double Convert(double Value, PressureRateUnit FromUnit, PressureRateUnit ToUnit) { // it would be faster to create a 5-by-5 table with each conversion constant, // but this is much easier. if (FromUnit == ToUnit || double.IsNaN(Value)) { return(Value); } // first, convert the unit to meters-per-sec double mb = Value / mRatios[(int)FromUnit]; // now, convert to the desired unit return(mb * mRatios[(int)ToUnit]); }
public static string ToString(PressureRateUnit Unit) { return(mUnitStrings[(int)Unit]); }
public static string DspString(double Value, PressureRateUnit FromUnit, PressureRateUnit ToUnit) { return(DspString(Convert(Value, FromUnit, ToUnit), ToUnit)); }
public static string LogString(double Value, PressureRateUnit FromUnit, PressureRateUnit ToUnit, CultureInfo Culture) { return(LogString(Convert(Value, FromUnit, ToUnit), ToUnit, Culture)); }