MightyLittleGeodesy.Positions.WGS84Position.ConvToDmsString C# (CSharp) Méthode

ConvToDmsString() private méthode

private ConvToDmsString ( double value, Char positiveValue, Char negativeValue ) : string
value double
positiveValue Char
negativeValue Char
Résultat string
        private string ConvToDmsString(double value, Char positiveValue, Char negativeValue)
        {
            if (value == double.MinValue)
            {
                return string.Empty;
            }

            var degrees = Math.Floor(Math.Abs(value));
            var minutes = Math.Floor((Math.Abs(value) - degrees) * 60);
            var seconds = (Math.Abs(value) - degrees - minutes / 60) * 3600;

            return string.Format(
                "{0} {1}º {2}' {3}\"",
                value >= 0 ? positiveValue : negativeValue,
                degrees,
                minutes,
                Math.Round(seconds, 5).ToString(CultureInfo.InvariantCulture));
        }