关于类型转换和保留小数点后两位的问题
从recordset中取出的数值,怎样才能保留小数点后两位输出啊
Response.Write(rs( "test ").value)
输出的是
1.36894117647059
怎样才能保留小数点后两位啊?
[解决办法]
double k = 345464.141592653589;
string a=k.ToString( ".## ");
Console.Write( "{0} ", a);
Console.ReadLine();
[解决办法]
string str=rs( "test ").value;
str.Format();
详细在MSDN中的String.Format()
[解决办法]
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.chs/cpref2/html/M_System_String_Format_1_af0ddb68.htm