Jump to content

FormatGRID

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (FormatGRID – created via PowerShell script (2025-11-11T21:12:45Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: FormatGRID
Function Description: Converts a 3D vector into a simplified GRID string by extracting the MGRS digraph and first digit of easting and northing values scaled by 10,000, then concatenating them into a readable format.
File Location: cmm.stringFunctions.lua
Syntax: CMM.FormatGRID( 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.FormatGRID({x=10, y=20, z=30})
Example Description: Returns "S123" when given a vector, where S is the digraph and 1, 2, 3 are the first digits of easting and northing after dividing by 10,000.
Related Functions:
Notes: