ToString
double temp=3.1415;
(F)Fixed point:string str1=temp.toString(“f1”);//保留一位小数 四舍五入 结果:3.1
(F)Fixed point:string str2=temp.toString(“f2”);//保留两位小数,四舍五入 下面一次类推 结果:3.14
(N)Number:string str2=temp.toString(“N”);//保留 结果:3.14
(G)General (default):string str2=temp.toString(“G”);//保留 结果:3.1415
§Percent:string str2=temp.toString(“P”);//保留 结果:314.16%
(E)Scientific:string str2=temp.toString(“E”);//保留 结果E:3.1416E+000
©Currency:string str2=temp.toString(“C”);//保留 结果:¥3.14