mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 03:39:33 +02:00
* fixed TextToFloat for platforms where currency = Int64 (webtbs/tw4093)
git-svn-id: trunk@1402 -
This commit is contained in:
parent
758337d115
commit
f67ffaa7c8
@ -939,6 +939,7 @@ Function TextToFloat(Buffer: PChar; Var Value; ValueType: TFloatValue): Boolean;
|
|||||||
Var
|
Var
|
||||||
E,P : Integer;
|
E,P : Integer;
|
||||||
S : String;
|
S : String;
|
||||||
|
TempValue: extended;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
S:=StrPas(Buffer);
|
S:=StrPas(Buffer);
|
||||||
@ -953,7 +954,11 @@ Begin
|
|||||||
S[P] := '.';
|
S[P] := '.';
|
||||||
case ValueType of
|
case ValueType of
|
||||||
fvCurrency:
|
fvCurrency:
|
||||||
Val(S,Currency(Value),E);
|
begin
|
||||||
|
// needed for platforms where Currency = Int64
|
||||||
|
Val(S,TempValue,E);
|
||||||
|
Currency(Value) := TempValue;
|
||||||
|
end;
|
||||||
fvExtended:
|
fvExtended:
|
||||||
Val(S,Extended(Value),E);
|
Val(S,Extended(Value),E);
|
||||||
fvDouble:
|
fvDouble:
|
||||||
|
Loading…
Reference in New Issue
Block a user