12.2436°=12°+0.2436x60’=12°+14.616’=12°14‘+0.616x60”=12°14‘+36.96“=12°20'36.96“
/// <summary> /// 角度转化度分秒 /// </summary> /// <param name="angle"></param> /// <returns></returns> private string AngleConversion(decimal angle) { var d = Convert.ToInt32(angle.ToString().Split('.')[0]); var ms = ((angle - d) * 60).ToString().Split('.'); var m = Convert.ToInt32(ms[0]); var s = ms.Length > 1 ? Convert.ToDecimal("0." + ms[1]) * 60 : 0; var format = $"{d}°{m}'{s}\""; return format; }
标签:分秒,12,angle,C#,Convert,转化,ms,var From: https://www.cnblogs.com/weilphome/p/17996680