在C#中,爲什麼不能int.TryParse解析數字分組(但double.TryParse可以)?爲什麼不能int.TryParse解析數字分組(但double.TryParse可以)?
int i1 = 13579;
string si1 = i1.ToString("N0"); //becomes 13,579
int i2 = 0;
bool result1 = int.TryParse(si1, out i2); //gets false and 0
double d1 = 24680.0;
string sd1 = d1.ToString("N0"); //becomes 24,680
double d2 = 0;
bool result2 = double.TryParse(sd1, out d2); //gets true and 24680.0
???