Dart Programming - floor Method


Advertisements

This method returns the largest integer less than or equal to a number.

Syntax

Number.floor()

Return Value

Returns the largest integer less than or equal to a number x.

Example

void main() { 
   var a = 2.9; 
   print("The floor value of 2.9 = ${a.floor()}"); 
} 

It will produce the following output −.

The floor value of 2.9 = 2
dart_programming_numbers.htm
Advertisements