Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Celsius"></param>
 /// <param name="Decimal"></param>
 /// <param name="Comma"></param>
 /// <param name="PostComma"></param>
 /// <param name="Text"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public static string CtoF(string Celsius, bool Decimal, bool Comma, int PostComma = 0, bool Text = true, string Error = Constants.ErrorMessage)
 {
     try
     {
         if (Celsius.Length <= Constants.VariableLength && Cores.NumberCheck(Celsius) && !Celsius.StartsWith("0") && PostComma >= Constants.PostCommaMinimum && PostComma <= Constants.PostCommaMaximum && Cores.UseCheck(Celsius))
         {
             if (Text)
             {
                 return(Cores.LastCheck2((Convert.ToDouble(Celsius) / Convert.ToInt32(Values.GetValue("Temperature", "Celsius", "Divide", Error)) * Convert.ToInt32(Values.GetValue("Temperature", "Celsius", "Multipy", Error)) + Convert.ToInt32(Values.GetValue("Temperature", "Celsius", "Add", Error))).ToString(), Decimal, Comma, PostComma, Error) + " F");
             }
             else
             {
                 return(Cores.LastCheck2((Convert.ToDouble(Celsius) / Convert.ToInt32(Values.GetValue("Temperature", "Celsius", "Divide", Error)) * Convert.ToInt32(Values.GetValue("Temperature", "Celsius", "Multipy", Error)) + Convert.ToInt32(Values.GetValue("Temperature", "Celsius", "Add", Error))).ToString(), Decimal, Comma, PostComma, Error));
             }
         }
         else
         {
             return(Error);
         }
     }
     catch
     {
         return(Error + Constants.ErrorTitle + "TE-CTF1!)");
     }
 }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Centimeter"></param>
 /// <param name="Decimal"></param>
 /// <param name="Comma"></param>
 /// <param name="PostComma"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public static string CMtoINCH(string Centimeter, bool Decimal, bool Comma, int PostComma = 0, string Error = Constants.ErrorMessage)
 {
     try
     {
         if (Centimeter.Length <= Constants.VariableLength && Cores.NumberCheck(Centimeter) && !Centimeter.StartsWith("0") && PostComma >= Constants.PostCommaMinimum && PostComma <= Constants.PostCommaMaximum && Cores.UseCheck(Centimeter))
         {
             if (Convert.ToInt64(Centimeter) >= 3)
             {
                 return(Cores.LastCheck2((Convert.ToInt64(Centimeter) * Convert.ToDouble(Values.GetValue("Typography", "CM", "INCH", Error))).ToString(), Decimal, Comma, PostComma, Error));
             }
             else
             {
                 return(Cores.LastCheck2("0", Decimal, Comma, PostComma, Error));
             }
         }
         else
         {
             return(Error);
         }
     }
     catch
     {
         return(Error + Constants.ErrorTitle + "TY-CTI1!)");
     }
 }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Pixel"></param>
 /// <param name="Decimal"></param>
 /// <param name="Comma"></param>
 /// <param name="PostComma"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public static string PXtoCM(string Pixel, bool Decimal, bool Comma, int PostComma = 0, string Error = Constants.ErrorMessage)
 {
     try
     {
         if (Pixel.Length <= Constants.VariableLength && Cores.NumberCheck(Pixel) && !Pixel.StartsWith("0") && PostComma >= Constants.PostCommaMinimum && PostComma <= Constants.PostCommaMaximum && Cores.UseCheck(Pixel))
         {
             if (Convert.ToInt64(Pixel) >= 38)
             {
                 return(Cores.LastCheck2((Convert.ToInt64(Pixel) * Convert.ToDouble(Values.GetValue("Typography", "PX", "CM", Error))).ToString(), Decimal, Comma, PostComma, Error));
             }
             else
             {
                 return(Cores.LastCheck2("0", Decimal, Comma, PostComma, Error));
             }
         }
         else
         {
             return(Error);
         }
     }
     catch
     {
         return(Error + Constants.ErrorTitle + "TY-PTC1!)");
     }
 }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Kilometers"></param>
 /// <param name="Decimal"></param>
 /// <param name="Comma"></param>
 /// <param name="PostComma"></param>
 /// <param name="Text"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public static string KPHtoMPH(string Kilometers, bool Decimal, bool Comma, int PostComma = 0, bool Text = true, string Error = Constants.ErrorMessage)
 {
     try
     {
         if (Kilometers.Length <= Constants.VariableLength && Cores.NumberCheck(Kilometers) && !Kilometers.StartsWith("0") && PostComma >= Constants.PostCommaMinimum && PostComma <= Constants.PostCommaMaximum && Cores.UseCheck(Kilometers))
         {
             if (Text)
             {
                 return(Cores.LastCheck2((Convert.ToDouble(Kilometers) * Convert.ToDouble(Values.GetValue("Speed", "KPH", "MPH", Error))).ToString(), Decimal, Comma, PostComma, Error) + " MPH");
             }
             else
             {
                 return(Cores.LastCheck2((Convert.ToDouble(Kilometers) * Convert.ToDouble(Values.GetValue("Speed", "KPH", "MPH", Error))).ToString(), Decimal, Comma, PostComma, Error));
             }
         }
         else
         {
             return(Error);
         }
     }
     catch
     {
         return(Error + Constants.ErrorTitle + "SD-KTM1!)");
     }
 }
Esempio n. 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Inch"></param>
 /// <param name="Decimal"></param>
 /// <param name="Comma"></param>
 /// <param name="PostComma"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public static string INCHtoPX(string Inch, bool Decimal, bool Comma, int PostComma = 0, string Error = Constants.ErrorMessage)
 {
     try
     {
         if (Inch.Length <= Constants.VariableLength && Cores.NumberCheck(Inch) && !Inch.StartsWith("0") && PostComma >= Constants.PostCommaMinimum && PostComma <= Constants.PostCommaMaximum && Cores.UseCheck(Inch))
         {
             string Result = (Convert.ToInt64(Inch) * Convert.ToDouble(Values.GetValue("Typography", "INCH", "PX", Error))).ToString();
             return(Cores.LastCheck2(Result, Decimal, Comma, PostComma, Error));
         }
         else
         {
             return(Error);
         }
     }
     catch
     {
         return(Error + Constants.ErrorTitle + "TY-ITP1!)");
     }
 }
Esempio n. 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Fahrenheit"></param>
 /// <param name="Decimal"></param>
 /// <param name="Comma"></param>
 /// <param name="PostComma"></param>
 /// <param name="Text"></param>
 /// <param name="Error"></param>
 /// <returns></returns>
 public static string FtoC(string Fahrenheit, bool Decimal, bool Comma, int PostComma = 0, bool Text = true, string Error = Constants.ErrorMessage)
 {
     try
     {
         if (Fahrenheit.Length <= Constants.VariableLength && Cores.NumberCheck(Fahrenheit) && !Fahrenheit.StartsWith("0") && PostComma >= Constants.PostCommaMinimum && PostComma <= Constants.PostCommaMaximum && Cores.UseCheck(Fahrenheit))
         {
             if (Convert.ToInt64(Fahrenheit) >= 32)
             {
                 if (Text)
                 {
                     return(Cores.LastCheck2(((Convert.ToDouble(Fahrenheit) - Convert.ToInt32(Values.GetValue("Temperature", "Fahrenheit", "Deduct", Error))) * Convert.ToInt32(Values.GetValue("Temperature", "Fahrenheit", "Multipy", Error)) / Convert.ToInt32(Values.GetValue("Temperature", "Fahrenheit", "Divide", Error))).ToString(), Decimal, Comma, PostComma, Error) + " C");
                 }
                 else
                 {
                     return(Cores.LastCheck2(((Convert.ToDouble(Fahrenheit) - Convert.ToInt32(Values.GetValue("Temperature", "Fahrenheit", "Deduct", Error))) * Convert.ToInt32(Values.GetValue("Temperature", "Fahrenheit", "Multipy", Error)) / Convert.ToInt32(Values.GetValue("Temperature", "Fahrenheit", "Divide", Error))).ToString(), Decimal, Comma, PostComma, Error));
                 }
             }
             else
             {
                 if (Text)
                 {
                     return(Cores.LastCheck2("0", Decimal, Comma, PostComma, Error) + " C");
                 }
                 else
                 {
                     return(Cores.LastCheck2("0", Decimal, Comma, PostComma, Error));
                 }
             }
         }
         else
         {
             return(Error);
         }
     }
     catch
     {
         return(Error + Constants.ErrorTitle + "TE-FTC1!)");
     }
 }