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
Pingback: Dart Programming - toDouble Method | Adglob Infosystem Pvt Ltd
Pingback: Dart Programming - Numbers | Adglob Infosystem Pvt Ltd