小数怎么用Convert.toint转化不成整数了????????
try
{
Response.Write("ToDecimal:"+Convert.ToDecimal("1.11").ToString()+"<br>");
}
catch
{}
try
{
Response.Write("ToDouble:"+Convert.ToDouble("1.11").ToString()+"<br>");
}
catch
{}
try
{
Response.Write("ToInt16:"+Convert.ToInt16("1.11").ToString()+"<br>");
}
catch
{}
try
{
Response.Write("ToInt32:"+Convert.ToInt32("1.11").ToString()+"<br>");
}
catch
{}
try
{
Response.Write("ToInt64:"+Convert.ToInt64("1.11").ToString()+"<br>");
}
catch
{}
try
{
Response.Write("ToUInt16:"+Convert.ToUInt16("1.11").ToString()+"<br>");
}
catch
{}
打印结果:
ToDecimal:1.11
ToDouble:1.11
整数怎么会报错?????