Exemplo n.º 1
0
        public static string ToString(double fvalue, FFormat format, int digitsAfterDelimiter)
        {
            double num = Math.Abs(fvalue);
            string result;

            if (format == FFormat.None)
            {
                result = DoubleToString(num, digitsAfterDelimiter);
            }
            else if (format == FFormat.DDDDDD)
            {
                result = DoubleToString(num, digitsAfterDelimiter) + "°";
            }
            else
            {
                string text = "";
                text = text + DoubleToString(Math.Truncate(num), 0) + "° ";
                double num2 = (num - Math.Truncate(num)) * 60.0;
                if (format == FFormat.DDMMMM)
                {
                    text = text + DoubleToString(num2, 4) + "'";
                }
                else
                {
                    text = text + string.Format("{0}", (int)Math.Truncate(num2)) + "' ";
                    num2 = (num2 - Math.Truncate(num2)) * 60.0;
                    text = text + DoubleToString(num2, 3) + "\"";
                }
                result = text;
            }
            return(result);
        }
Exemplo n.º 2
0
 public static string ToString(PointD latlon, FFormat fformat, int digitsAfterDelimiter)
 {
     if (fformat == FFormat.None)
     {
         return(String.Format("{0},{1}", ToString(latlon.Y, fformat, digitsAfterDelimiter), ToString(latlon.X, fformat, digitsAfterDelimiter)));
     }
     else
     {
         return(String.Format("{0} {1} {2} {3}", new string[] { GetLinePrefix(latlon.Y, DFormat.ENG_NS), ToString(latlon.Y, fformat, digitsAfterDelimiter), GetLinePrefix(latlon.X, DFormat.ENG_EW), ToString(latlon.X, fformat, digitsAfterDelimiter) }));
     }
 }
Exemplo n.º 3
0
 public static string ToString(double lat, double lon, FFormat fformat)
 {
     if (fformat == FFormat.None)
     {
         return(String.Format("{0},{1}", ToString(lat, fformat), ToString(lon, fformat)));
     }
     else
     {
         return(String.Format("{0} {1} {2} {3}", new string[] { GetLinePrefix(lat, DFormat.ENG_NS), ToString(lat, fformat), GetLinePrefix(lat, DFormat.ENG_EW), ToString(lon, fformat) }));
     }
 }
Exemplo n.º 4
0
 public static string ToString(double fvalue, FFormat format)
 {
     return(ToString(fvalue, format, 6));
 }