HII
How to convert decimal value to Degree Minute Second
in c# plz give me example in c# language?
Thanx
Convert decimal to degre
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Nov 6, 2013, 8:06 PM EST
http://stackoverflow.com/questions/6862684/converting-from-decimal-degrees-to-degrees-minutes-seconds-tenths
ranjan sahooRank #5,709 · 289 reputationPosted Nov 6, 2013, 8:15 PM EST
I want to store second value in _Arr[3].
public static string[] ConvertDecimaltoDegMin(float _value, string _LatorLong)
{
string[] _Arr = new string[4];
string _LatLong = Convert.ToString(_value).Replace("-", "");
string[] _DegMin = _LatLong.Split('.');
if (_LatorLong == "LAT")
if (_value < 0)
_Arr[0] = "S";
else
_Arr[0] = "N";
else if (_LatorLong == "LONG")
if (_value < 0)
_Arr[0] = "W";
else
_Arr[0] = "E";
_Arr[1] = _DegMin[0];
_Arr[2] = Math.Round((Math.Abs(_value) - Math.Truncate(Math.Abs(_value))) * 60).ToString();
_Arr[3] = ?
}