Core Function DDec

From Sputnik Wiki
Jump to: navigation, search
DDec( <expression> )

Contents

Description

Returns a double representation of a hexadecimal string.

Parameters

expression

The hexadecimal string to convert.

Return Value

Success: Returns a double.

Failure: Returns 0.

Remarks

The function only works with numbers that fit in a 64 bit signed floating point.

Example

$lol1 = (double)1337.77;
$fDHex = DHex($lol1);
$fDDec = DDec($fDHex);
println( "DOUBLE HEX: " . $fDHex ); // Prints 4094E7147AE147AE
println( "DOUBLE DEC: " . $fDDec ); // Prints 1337.77

Example with cast on a $variable

$var = 1337.77;
$fDHex = DHex((double)$var);
$fDDec = DDec($fDHex);
println( "DOUBLE HEX: " . $fDHex ); // Prints 4094E7147AE147AE
println( "DOUBLE DEC: " . $fDDec ); // Prints 1337.77
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox