HII
How to convert decimal value to Degree Minute Second
in c# plz give me example in c# language?
Thanx
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ranjan sahooPosted Nov 7, 2013, 1:15 AM
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] = ?
}
Sanjeeb LenkaPosted Nov 7, 2013, 1:06 AM
http://stackoverflow.com/questions/6862684/converting-from-decimal-degrees-to-degrees-minutes-seconds-tenths