uses SysUtils; function StrToExp(s: string): string; var f: Extended; begin f := StrToFloat(s); Result := FloatToStrF(f, ffExponent, 7, 2); end; 然后这么用: ShowMessage(StrToExp('2'));
delphi 实现科学计数法
最新推荐文章于 2024-06-06 10:05:48 发布
uses SysUtils; function StrToExp(s: string): string; var f: Extended; begin f := StrToFloat(s); Result := FloatToStrF(f, ffExponent, 7, 2); end; 然后这么用: ShowMessage(StrToExp('2'));