Like Float2CEStr this ccnverts a Float into a string without Padding & with Thousands Separators, except this removes all trailing 0's and the decimal separator if not needed.Unit
QESBPCSConvert
Declaration
Function Float2CEStr2(const X: Extended; const Decimals: Byte = 4): string;
Description
ESBNumPosSign controls whether a '+' Sign appears at the beginning for positive Integers. ESBBlankWhenZero can be set to True to have Zero returned as an Empty string, where Zero is dependent upon ESBTolerance. Also see Float2CEStr, Float2Str & Float2EStr
| X | Value to Convert to String. | 
| Decimals | is the desired number of Decimal places, defaults to 4 | 
Category
String/Float Conversion Routines
Implementation
 
  | function Float2CEStr2 (const X: Extended; const Decimals: Byte = 4): string;
begin
     Result := StripTChStr (Float2CEStr (X, Decimals), '0');
     if Result [Length (Result)] = '.' then
          Result := LeftStr (Result, Length (Result) - 1);
End; | 
Declaration
Function Float2CEStr2(const X: Double; const Decimals: Byte = 4): string;Implementation
 
  | function Float2CEStr2 (const X: Double; const Decimals: Byte = 4): string;
begin
     Result := StripTChStr (Float2CEStr (X, Decimals), '0');
     if Result [Length (Result)] = '.' then
          Result := LeftStr (Result, Length (Result) - 1);
End; | 
Declaration
Function Float2CEStr2(const X: Single; const Decimals: Byte = 4): string;Implementation
 
  | function Float2CEStr2 (const X: Single; const Decimals: Byte = 4): string;
begin
     Result := StripTChStr (Float2CEStr (X, Decimals), '0');
     if Result [Length (Result)] = '.' then
          Result := LeftStr (Result, Length (Result) - 1);
End; | 
| HTML generated by Time2HELP | 
http://www.time2help.com