public void AngleFormatTest() { AngleFormat af = new AngleFormat(AngleFormat.PatternLatitudeDDMMSS); String s1 = String.Format(af, "{0}", Math.PI); s1 = String.Format(af, "{0:DdMmSs}", Math.PI); Double v1 = af.Parse(s1); Assert.AreEqual(Math.PI, v1); s1 = String.Format(af, "{0:D°M'S\"N}", -0.9 * Math.PI); v1 = af.Parse(s1); Assert.AreEqual(-0.9 * Math.PI, v1); }
private static double ParseAngle(String s) { return(format.Parse(s)); }