Substr.FloatToStr Method

function FloatToStr(const Value: Double): Substring; overload; inline;

The text of Value with up to 15 significant digits, correctly rounded.

#NameTypeDescription
1ValueDoublescalar

Returns: Substring

Remarks:

Call it qualified: Substr.FloatToStr(x).

Examples

Texts without a decimal separator.

uses Substr, System.SysUtils;

procedure Example;
begin
    Assert(Substr.FloatToStr(1e20) = '1E20');
    Assert(Substr.FloatToStr(-3.0) = '-3');
end;