public static string DspString(double Value, TemperatureRateUnit Unit) { if (double.IsNaN(Value)) { return(""); } return(Value.ToString(mDspFmt[(int)Unit], CultureInfo.CurrentCulture)); }
public static string LogString(double Value, TemperatureRateUnit Unit, CultureInfo Culture) { if (double.IsNaN(Value)) { return(""); } return(Value.ToString(mLogFmt[(int)Unit], Culture)); }
public static double Convert(double Value, TemperatureRateUnit FromUnit, TemperatureRateUnit ToUnit) { // it would be faster to create a 4-by-4 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 rate = Value / mRatios[(int)FromUnit]; // now, convert to the desired unit return(rate * mRatios[(int)ToUnit]); }
public static string ToString(TemperatureRateUnit Unit) { return(mUnitStrings[(int)Unit]); }
public static string DspString(double Value, TemperatureRateUnit FromUnit, TemperatureRateUnit ToUnit) { return(DspString(Convert(Value, FromUnit, ToUnit), ToUnit)); }
public static string LogString(double Value, TemperatureRateUnit FromUnit, TemperatureRateUnit ToUnit, CultureInfo Culture) { return(LogString(Convert(Value, FromUnit, ToUnit), ToUnit, Culture)); }