Core Function Hex

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
UberFoX (Talk | contribs)
(Created page with "<pre> Hex( <expression>, <length> ) </pre> === Description === Returns a string representation of an integer type converted to hexadecimal === Parameters === ==== expression ...")
Newer edit →

Revision as of 06:50, 11 November 2011

Hex( <expression>, <length> )

Contents

Description

Returns a string representation of an integer type converted to hexadecimal

Parameters

expression

The expression to convert.

expression

Optional; Number of characters to be returned (up to 8) for integer. Characters are truncated from the left-hand side if length is too small.

Return Value

Success: Returns a string of length characters, zero-padded if necessary for integer.

Failure: Returns "" (blank string).

Remarks

The function only works with numbers that fit in a 32 bit signed integer OR 64 bit signed integer.

Example

$result = Hex(1033)
println($result) ; prints "409"
 
$result = Hex(1033, 4)
println($result) ; prints "0409"
 
$result = Hex(1033, 8)
println($result) ; prints "00000409"
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox