Jump to content

FormatLL

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (FormatLL – created via PowerShell script (2025-11-11T21:12:46Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: FormatLL
Function Description: Converts a 3D vector to a formatted latitude and longitude string with optional DMS or decimal minute precision. It extracts the latitude and longitude from the input vector, determines hemispheres, and formats the output based on the DMS flag and accuracy settings.
File Location: cmm.stringFunctions.lua
Syntax: CMM.FormatLL( table vec3 , number acc , boolean DMS )
Return Value: string
Parameters: Name Description
vec3A table representing a 3D vector {x, y, z} used to extract latitude and longitude via coord.LOtoLL.
accAccuracy level for decimal precision in minutes or seconds, defaults to 0 for no decimals.
DMSIf true, outputs degrees, minutes, and seconds with specified accuracy; if false, outputs degrees and decimal minutes.
Example: CMM.FormatLL({x=10, y=20, z=30}, 2, true)
Example Description: Returns "N 40° 23' 15.67" E 120° 34' 56.78" when given a vector and 2 decimal places with DMS format.
Related Functions:
Notes: