wossname
Nov 27th, 2003, 03:16 AM
How do I get the user's number into the double?
string temp;
double myDBL;
Console.Write("Enter a number: ");
temp = Console.ReadLine(); //something like "231.44324"
//perform some tests on the string to make sure its ok
//...
myDBL= temp; //causes compiler cast error
Error: Cannot convert type 'string' to 'double'
string temp;
double myDBL;
Console.Write("Enter a number: ");
temp = Console.ReadLine(); //something like "231.44324"
//perform some tests on the string to make sure its ok
//...
myDBL= temp; //causes compiler cast error
Error: Cannot convert type 'string' to 'double'