Answers for "cast a string to double dart"

2

dart to double

void main() { 
   int n1 = 2; 
   var value = n1.toDouble(); 
   print("Output = ${value}"); 
}
Posted by: Guest on November-13-2021
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

Code answers related to "Dart"

Browse Popular Code Answers by Language