mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 12:59:24 +02:00
* TValue.Asstring for double
This commit is contained in:
parent
c70e82bea6
commit
dfd8f5c62b
@ -244,7 +244,8 @@ type
|
||||
function AsInterface: IInterface;
|
||||
function AsPointer : Pointer;
|
||||
function AsVariant : Variant;
|
||||
function ToString: String;
|
||||
function ToString: String; overload;
|
||||
function ToString(aSettings: TFormatSettings): String; overload;
|
||||
function GetArrayLength: SizeInt;
|
||||
function GetArrayElement(AIndex: SizeInt): TValue;
|
||||
procedure SetArrayElement(AIndex: SizeInt; constref AValue: TValue);
|
||||
@ -4516,6 +4517,13 @@ end;
|
||||
|
||||
function TValue.ToString: String;
|
||||
|
||||
begin
|
||||
Result:=ToString(TFormatSettings.Invariant);
|
||||
end;
|
||||
|
||||
function TValue.ToString(aSettings : TFormatSettings): String;
|
||||
|
||||
|
||||
function GetArrayElType(ATypeInfo: PTypeInfo): PTypeInfo;
|
||||
begin
|
||||
case ATypeInfo^.Kind of
|
||||
@ -4541,10 +4549,7 @@ begin
|
||||
tkUString : result := AsUnicodeString;
|
||||
tkSString,
|
||||
tkAString : result := AsAnsiString;
|
||||
tkFloat : begin
|
||||
Str(AsDouble:12:4,Result);
|
||||
Result:=TrimLeft(Result)
|
||||
end;
|
||||
tkFloat : result := FloatToStr(asDouble,aSettings);
|
||||
tkInteger : result := IntToStr(AsInteger);
|
||||
tkQWord : result := IntToStr(AsUInt64);
|
||||
tkInt64 : result := IntToStr(AsInt64);
|
||||
|
Loading…
Reference in New Issue
Block a user