Answers for "convert string double to int flutter"

25

Flutter turn string to int

// String -> int
main () {
    var one = int.parse('1');
    print(one == 1); // prints true
}
Posted by: Guest on April-20-2020
2

double to int flutter

double x = 2.5;
 
  int a = x.toInt();
  int b = x.truncate();
  int c = x.round();
  int d = x.ceil();
  int e = x.floor();
 
  print(a); // 2
  print(b); // 2
  print(c); // 3
  print(d); // 3
  print(3); // 2
Posted by: Guest on July-27-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language