Core Function DecPad
From Sputnik Wiki
DecPad( <expression>, <count> )
Contents |
Description
Pads numeric string to a given number of chars (Filling in the gap with zeros).
Parameters
expression
The expression to pad.
count
The length of the final string (Equal to or higher than current length).
Return Value
Success: Returns padded string.
Failure: Returns unpadded string.
Remarks
None.
Example
$binary = Pack("ifz0", (int)100, (float)777.42, "Hello"); $i = 0; foreach( $binary as $item ) { println( "Index '" . DecPad($i, 4) . "' " . "Dec '$item' " . "Hex '" . Hex($item) . "' " . "Char '" . Chr($item) . "'" ); $i++; }