Example #1
0
 public static string DspString(double Value, TemperatureRateUnit Unit)
 {
     if (double.IsNaN(Value))
     {
         return("");
     }
     return(Value.ToString(mDspFmt[(int)Unit], CultureInfo.CurrentCulture));
 }
Example #2
0
 public static string LogString(double Value, TemperatureRateUnit Unit, CultureInfo Culture)
 {
     if (double.IsNaN(Value))
     {
         return("");
     }
     return(Value.ToString(mLogFmt[(int)Unit], Culture));
 }
Example #3
0
        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]);
        }
Example #4
0
 public static string ToString(TemperatureRateUnit Unit)
 {
     return(mUnitStrings[(int)Unit]);
 }
Example #5
0
 public static string DspString(double Value, TemperatureRateUnit FromUnit, TemperatureRateUnit ToUnit)
 {
     return(DspString(Convert(Value, FromUnit, ToUnit), ToUnit));
 }
Example #6
0
 public static string LogString(double Value, TemperatureRateUnit FromUnit, TemperatureRateUnit ToUnit, CultureInfo Culture)
 {
     return(LogString(Convert(Value, FromUnit, ToUnit), ToUnit, Culture));
 }