Answers for "flutter dart convert string to int"

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
9

string to double dart

// String -> double
main () {
    var onePointOne = double.parse('1.1');
    print(onePointOne == 1.1); // prints true
}
Posted by: Guest on May-05-2020
-1

convert from int64 to int dart

double d = 20.5;

int i = d.toInt(); // i = 20
int i = d.round(); // i = 21
int i = d.ceil();  // i = 21
int i = d.floor(); // i = 20
Posted by: Guest on November-18-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language