Dart Programming – toInt Method

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
dart programming tolnt method

In this guide, we will discuss toInt Method in Dart Programming Language. This method returns the integer representation of the number’s value.

Syntax

Number.toInt()

Return Value

Returns an int representing the specified Number object.

Example

void main() { 
   double n1 = 2.0; 
   var value = n1.toInt(); 
   print("Output = ${value}"); 
} 

It will produce the following output −.

Output = 2

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply