Exemplo n.º 1
0
        public static double Convert(this double e, Widgets.WeatherData.UnitType to)
        {
            double v = e;

            if (to == Widgets.WeatherData.UnitType.Celcius)
            {
                v = v - 273.15;
            }
            else if (to == Widgets.WeatherData.UnitType.Fahrenheit)
            {
                v = (v - 273.15) * 1.8f + 32.0f;
            }

            return(v);
        }
Exemplo n.º 2
0
 public static string ToString(this Widgets.WeatherData.UnitType e)
 {
     return(e == Widgets.WeatherData.UnitType.Kelvin ? "K" : (e == Widgets.WeatherData.UnitType.Fahrenheit ? "°F" : "°C"));
 }