Core Function Int32

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

Contents

Description

Returns the signed 32-bit integer (whole number) representation of an expression

Parameters

Expression

An expression to convert.

Return Value

Success: Returns the new number.

Failure: Returns 0.

Remarks

Example

$Number = 777.42;
$newNumber = int32( $Number );
println("Old number: $Number");
println("New number: $newNumber");
// Prints
// Old number: 777.42
// New number: 777

Alternative method using casting :

$Number = 777.42;
$newNumber = (int32)$Number;
println("Old number: $Number");
println("New number: $newNumber");
// Prints
// Old number: 777.42
// New number: 777
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox