Format Script Strings 5.1 OC string string text String into which to insert values. ... Values to be inserted. Composes a string of several values. To do this, text is scanned for placeholders starting with '%' which are then replaced by the parameters.
The general syntax for these placeholders is:
%[length][.precision]typeExcept for type all fields are optional. Type specifies the data type of the parameter to be expected. It can be one of the following values: TypeMeaning dWhole number (int) xWhole number (int), hexadecimal representation (0123456789abcdef) XWhole number (int), hexadecimal representation (0123456789ABCDEF) iid (with ids, length and precision parameters do not apply) sString vAny. Primarily useful for debugging.
Length specifies the minimum number of characters used to display the value. If the value is shorter, the display is padded on the left with space characters, or with zeroes if there is a '0' before the length specification.

The meaning of the precision field varies with the data type: for integers (d) it specifies the minimum display length (the number is padded with zeroes at the beginning); however for strings (s) it specifies the maximum number of characters to be displayed.
Log(Format("Hello, %s.You have %d Clonks!", GetPlayerName(0), GetCrewCount(0))); Displays "Hello Twonky, you have 3 Clonks!" (names vary). Log(Format("'%3d'", 1)); Displays: ' 1' Log(Format("'%i'", GetID(GetCursor()))); Displays (e.g.): 'Clonk' Log(Format("'%3.2d'", 5)); Displays: ' 05' Log(Format("'%.2s'", "test")); Displays: 'te' Log(Format("'%03d'", 12)); Displays: '012'
Sven22001-11