15 1 0 4000 1 https://codeblock.co.za 300 true 0

Math.floor()

0 Comments

Programming Language

JavaScript [Version: ECMAScript (ECMA-262)]

Syntax

Typical Usage

Rounds a number down to the next largest integer less than or equal to the given value.

Accepted Parameters

value (integer) (Required): The float value you wish to round down.

Return Value(s)

The number rounded down.

Examples of Math.floor()

Example 1

console.log(Math.floor(2.1234))
 // Output = 2

The above will output 2.

Example 2

console.log(Math.floor(68.7654))
// Output = 68

The above will output 68.


Similar Functions in Other Languages

Was This Helpful?

Previous Post
Math.ceil()
Next Post
Math.round()

0 Comments

Leave a Reply