Core Function DecPad

From Sputnik Wiki
Revision as of 11:38, 2 December 2011 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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++;
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox