Converts a Float into a string in Scientific Notation without Padding.Unit
QESBPCSConvert
Declaration
Function SciFloat2EStr(const X: Extended; const Decimals: Byte = 4): string;
Description
This is of the form d.dddEnn. ESBBlankWhenZero can be set to True to have Zero returned as an Empty string, where Zero is dependent upon ESBTolerance.
| X | Value to Convert to String. | 
| Decimals | is the desired number of Decimal places in the Mantissa, defaults to 4 | 
Category
String/Float Conversion Routines
Implementation
 
  | function SciFloat2EStr (const X: Extended; const Decimals: Byte = 4): string;
begin
     if ESBBlankWhenZero and FloatIsZero (X) then
     begin
          Result := '';
          Exit;
     end;
     try
          Result := FloatToStrF (X, ffExponent, Decimals + 1, 0)
     except
          Result := '';
     end;
End; | 
Declaration
Function SciFloat2EStr(const X: Double; const Decimals: Byte = 4): string;Implementation
 
  | function SciFloat2EStr (const X: Double; const Decimals: Byte = 4): string;
begin
     if ESBBlankWhenZero and FloatIsZero (X) then
     begin
          Result := '';
          Exit;
     end;
     try
          Result := FloatToStrF (X, ffExponent, Decimals + 1, 0)
     except
          Result := '';
     end;
End; | 
Declaration
Function SciFloat2EStr(const X: Single; const Decimals: Byte = 4): string;Implementation
 
  | function SciFloat2EStr (const X: Single; const Decimals: Byte = 4): string;
begin
     if ESBBlankWhenZero and FloatIsZero (X) then
     begin
          Result := '';
          Exit;
     end;
     try
          Result := FloatToStrF (X, ffExponent, Decimals + 1, 0)
     except
          Result := '';
     end;
End; | 
| HTML generated by Time2HELP | 
http://www.time2help.com