Floor

From AutoIt Wiki

Jump to: navigation, search

Returns a number rounded down to the closes integer. Adapted from AutoIt docs.

Contents

Syntax

$x = Floor(expr)

Parameters

exprAny valid numeric expression.

Return Value

Returns the rounded number.

Example

Dim $msg

$msg = ""

$msg = $msg & "Floor(4.8) = " & Floor(4.8) & @CR
$msg = $msg & "Floor(4.5) = " & Floor(4.5) & @CR
$msg = $msg & "Floor(4.3) = " & Floor(4.3) & @CR
$msg = $msg & "Floor(4) = " & Floor(4) & @CR
$msg = $msg & "Floor(-4.3) = " & Floor(-4.3) & @CR
$msg = $msg & "Floor(-4.5) = " & Floor(-4.5) & @CR
$msg = $msg & "Floor(-4.8) = " & Floor(-4.8) & @CR
$msg = $msg & "Floor(-4) = " & Floor(-4) & @CR

MsgBox(64, "Testing", $msg)

Related Functions

Int Number Round Ceiling

Personal tools