Difference between revisions of "MIST tostringMGRS"

From DCS World Wiki - Hoggitworld.com
 
(fix missing parentheses on function call)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{Mission Scripting
 
{{Mission Scripting
  
|fName= mist.toStringMGRS
+
|fName= mist.tostringMGRS
  
 
|vNum = Mist 2.0
 
|vNum = Mist 2.0
Line 54: Line 54:
 
|rtnExamples=  
 
|rtnExamples=  
 
The same MGRS coordinate with different n values:
 
The same MGRS coordinate with different n values:
   mist.utils.tostringMGRS(table, 0) returns 38T AB  
+
   mist.tostringMGRS(table, 0) returns 38T AB  
   mist.utils.tostringMGRS(table, 3) returns 38T AB 123 123  
+
   mist.tostringMGRS(table, 3) returns 38T AB 123 123  
   mist.utils.tostringMGRS(table, 5) returns 38T AB 12345 12345
+
   mist.tostringMGRS(table, 5) returns 38T AB 12345 12345
  
 
|example= <code>
 
|example= <code>
 
do
 
do
   local mgrs = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('myUnit'):getPosition.p))
+
   local mgrs = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('myUnit'):getPosition().p))
   trigger.action.outText("Enemy group spotted at grid " .. mist.utils.toStringMGRS(mgrs, 4)", 60)
+
   trigger.action.outText("Enemy group spotted at grid " .. mist.tostringMGRS(mgrs, 4), 60)
  
 
end
 
end

Latest revision as of 19:35, 15 June 2022


mist.tostringMGRS

Added with: Mist 2.0
Description
Returns a string of the MGRS coordinate specified in table MGRS to the accuracy of number n. Acceptable values for n are 0, 1, 2, 3, 4, or 5
Syntax
string mist.tostringMGRS(table MGRS ,number n )
Valid Input Values:
MGRS = MGRS Table

n = any number 0 through 5

Return value:
string
Return example:
The same MGRS coordinate with different n values:
 mist.tostringMGRS(table, 0) returns 38T AB 
 mist.tostringMGRS(table, 3) returns 38T AB 123 123 
 mist.tostringMGRS(table, 5) returns 38T AB 12345 12345
Usage Examples:

do

 local mgrs = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('myUnit'):getPosition().p))
 trigger.action.outText("Enemy group spotted at grid " .. mist.tostringMGRS(mgrs, 4), 60)

end

Notes:
Related Functions
tostringMGRS, tostringLL, tostringBR, getMGRSString, getLLString, getBRString, getLeadingPos, getLeadingMGRSString, getLeadingLLString, getLeadingBRString, getMilString, getClockString, getDateString, stringMatch, stringCondense

Scripting Engine

MIST Root Page