mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 12:07:58 +02:00
* patch by Евгений Савин to make Variant to string convertion use CurrToStr for varCurrency, resolves #40624
This commit is contained in:
parent
9ac0a54ad2
commit
b6ccf369b9
@ -1283,7 +1283,7 @@ begin
|
||||
{$ifndef FPUNONE}
|
||||
varSingle : Result := FloatToStr(vSingle);
|
||||
varDouble : Result := FloatToStr(vDouble);
|
||||
varCurrency : Result := FloatToStr(vCurrency);
|
||||
varCurrency : Result := CurrToStr(vCurrency);
|
||||
varDate : Result := VarDateToString(vDate);
|
||||
{$endif}
|
||||
varBoolean : Result := BoolToStr(vBoolean, True);
|
||||
@ -1306,7 +1306,7 @@ begin
|
||||
{$ifndef FPUNONE}
|
||||
varSingle : Result := FloatToStr(PSingle(vPointer)^);
|
||||
varDouble : Result := FloatToStr(PDouble(vPointer)^);
|
||||
varCurrency : Result := FloatToStr(PCurrency(vPointer)^);
|
||||
varCurrency : Result := CurrToStr(PCurrency(vPointer)^);
|
||||
varDate : Result := VarDateToString(PDate(vPointer)^);
|
||||
{$endif}
|
||||
varBoolean : Result := BoolToStr(PWordBool(vPointer)^, True);
|
||||
@ -1350,7 +1350,7 @@ begin
|
||||
{$ifndef FPUNONE}
|
||||
varSingle : Result := FloatToStr(vSingle);
|
||||
varDouble : Result := FloatToStr(vDouble);
|
||||
varCurrency : Result := FloatToStr(vCurrency);
|
||||
varCurrency : Result := CurrToStr(vCurrency);
|
||||
varDate : Result := VarDateToString(vDate);
|
||||
{$endif}
|
||||
varBoolean : Result := BoolToStr(vBoolean, True);
|
||||
@ -1373,7 +1373,7 @@ begin
|
||||
{$ifndef FPUNONE}
|
||||
varSingle : Result := FloatToStr(PSingle(vPointer)^);
|
||||
varDouble : Result := FloatToStr(PDouble(vPointer)^);
|
||||
varCurrency : Result := FloatToStr(PCurrency(vPointer)^);
|
||||
varCurrency : Result := CurrToStr(PCurrency(vPointer)^);
|
||||
varDate : Result := VarDateToString(PDate(vPointer)^);
|
||||
{$endif}
|
||||
varBoolean : Result := BoolToStr(PWordBool(vPointer)^, True);
|
||||
|
22
tests/webtbs/tw40624.pp
Normal file
22
tests/webtbs/tw40624.pp
Normal file
@ -0,0 +1,22 @@
|
||||
program tw40624;
|
||||
|
||||
uses
|
||||
SysUtils
|
||||
{ you can add units after this };
|
||||
|
||||
var
|
||||
C: Currency;
|
||||
V: Variant;
|
||||
S: string;
|
||||
begin
|
||||
C := 822337203685477.5807;
|
||||
V := C;
|
||||
DefaultFormatSettings.DecimalSeparator := '.';
|
||||
|
||||
if CurrToStr(C) <> '822337203685477.5807' then
|
||||
Halt(1);
|
||||
S := V;
|
||||
if S <> '822337203685477.5807' then
|
||||
Halt(2);
|
||||
WriteLn('OK');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user