C#入门 经典通用数据格式(G/g)PPT

通用数据格式(G/g)字符G表示通用数据格式。该数据可能以科学计数法或定点数据格式表示。Visual C# 中:

- 无数字(无浮点数精度)的 G 表示定点数据格式

- 有指定数字(精度)的 G 表示科学计数法

例如:

double fCurValue=12345678.125;

String str1=String.Format(null, “{0:G}”, fCurValue); //12345678.125

String str2=String.Format(null, “{0:G4}”, fCurValue); //1.234E+07

ppt 文件大小:4.81MB