"Sputnik" help  
Sputnik Help
Double(<value>)

Description

Converts the specified value to a double. If the value is already a double, it returns it as is. If the value cannot be feasibly converted to a double within the scope of this function, it returns null.

Parameters

<value> The value to be converted to a double.

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

The Double function aims to convert the input value to a double. If the conversion is successful, it returns the double representation; otherwise, it returns null.

Related

Casting, IsVarDouble

Example

Example of usage:

my $result = Double(42);
say $result;
// PRINTS
// 42.0

my $result = Double("3.14");
say $result;
// PRINTS
// 3.14

my $result = Double("Hello");
say $result;
// PRINTS
// 0

Casting:

my $result = (Double)42;
say $result;
// PRINTS
// 42.0

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org