+ comp and int64 overloads for floattostr(f)

git-svn-id: trunk@2403 -
This commit is contained in:
Jonas Maebe 2006-02-02 10:33:12 +00:00
parent 4bee83c736
commit 7338c03fac
2 changed files with 34 additions and 0 deletions

View File

@ -1235,6 +1235,19 @@ Begin
Result := FloatToStrFIntl(Value, ffGeneral, 15, 0, fvSingle);
End;
Function FloatToStr(Value: Comp): String;
Begin
Result := FloatToStrFIntl(Value, ffGeneral, 15, 0, fvComp);
End;
{$ifndef FPC_COMP_IS_INT64}
Function FloatToStr(Value: Int64): String;
Begin
Result := FloatToStrFIntl(Comp(Value), ffGeneral, 15, 0, fvComp);
End;
{$endif FPC_COMP_IS_INT64}
Function FloatToText(Buffer: PChar; Value: Extended; format: TFloatFormat; Precision, Digits: Integer): Longint;
Var
Tmp: String[40];
@ -1266,12 +1279,25 @@ begin
result := FloatToStrFIntl(value,format,precision,digits,fvSingle);
end;
Function FloatToStrF(Value: Comp; format: TFloatFormat; Precision, Digits: Integer): String;
begin
result := FloatToStrFIntl(value,format,precision,digits,fvComp);
end;
{$ifndef FPC_COMP_IS_INT64}
Function FloatToStrF(Value: Int64; format: TFloatFormat; Precision, Digits: Integer): String;
begin
result := FloatToStrFIntl(Comp(value),format,precision,digits,fvComp);
end;
{$endif FPC_COMP_IS_INT64}
Function CurrToStrF(Value: Currency; Format: TFloatFormat; Digits: Integer): string;
begin
result:=FloatToStrF(Value,Format,19,Digits);
end;
Function FloatToDateTime (Const Value : Extended) : TDateTime;
begin
If (Value<MinDateTime) or (Value>MaxDateTime) then

View File

@ -124,7 +124,11 @@ Function FloatToStrF(Value: Extended; format: TFloatFormat; Precision, Digits: I
{$endif FPC_HAS_TYPE_EXTENDED}
Function FloatToStrF(Value: Double; format: TFloatFormat; Precision, Digits: Integer): String;
Function FloatToStrF(Value: Single; format: TFloatFormat; Precision, Digits: Integer): String;
Function FloatToStrF(Value: Comp; format: TFloatFormat; Precision, Digits: Integer): String;
Function FloatToStrF(Value: Currency; format: TFloatFormat; Precision, Digits: Integer): String;
{$ifndef FPC_COMP_IS_INT64}
Function FloatToStrF(Value: Int64; format: TFloatFormat; Precision, Digits: Integer): String;
{$endif FPC_COMP_IS_INT64}
Function CurrToStrF(Value: Currency; Format: TFloatFormat; Digits: Integer): string;
{$ifdef FPC_HAS_TYPE_EXTENDED}
Function FloatToStr(Value: Extended): String;
@ -132,6 +136,10 @@ Function FloatToStr(Value: Extended): String;
Function FloatToStr(Value: Double): String;
Function FloatToStr(Value: Single): String;
Function FloatToStr(Value: Currency): String;
Function FloatToStr(Value: Comp): String;
{$ifndef FPC_COMP_IS_INT64}
Function FloatToStr(Value: Int64): String;
{$endif FPC_COMP_IS_INT64}
Function StrToFloat(Const S : String) : Extended;
Function StrToFloatDef(Const S: String; Const Default: Extended): Extended;
Function TryStrToFloat(Const S : String; Var Value: Single): Boolean;