Function to convert Radians to Degrees, Mins, Secs

Share your advanced PureBasic knowledge/code with the community.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Function to convert Radians to Degrees, Mins, Secs

Post 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
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;