Page 1 of 1

Function to convert Radians to Degrees, Mins, Secs

Posted: Mon Oct 24, 2005 12:16 pm
by Psychophanta
Code updated For 5.20+

Code: Select all

Procedure.s ToDegMinSec(i.f,radians.b=0)
  If radians:i*180/#PI:EndIf
  If i<0 And i>-1.0:Deg.s="-":EndIf
  Deg.s+Str(Int(i))+"ยบ"
  i=Abs((i-Int(i))*60)
  Deg.s+Str(Int(i))+"'"
  Deg.s+StrF((i-Int(i))*60)+"''"
  ProcedureReturn Deg.s
EndProcedure