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