Jump to content

FormatMGRS

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (FormatMGRS – 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: FormatMGRS
Function Description: Converts a 3D vector to a standardized MGRS string using latitude and longitude coordinates, then formats it with UTM zone, digraph, and easting/northing values padded to five digits.
File Location: cmm.stringFunctions.lua
Syntax: CMM.FormatMGRS( table vec3 )
Return Value: string
Parameters: Name Description
vec3A table representing a 3D vector {x, y, z} used to extract latitude and longitude via coord.LOtoLL.
Example: CMM.FormatMGRS({x=10, y=20, z=30})
Example Description: Returns "33 S 45678 54321" when given a vector, where the UTM zone is 33, the digraph is S, and easting and northing are padded to five digits.
Related Functions:
Notes: