From f67ffaa7c8b87fcf6187efc104366295adb37698 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 16 Oct 2005 06:28:14 +0000 Subject: [PATCH] * fixed TextToFloat for platforms where currency = Int64 (webtbs/tw4093) git-svn-id: trunk@1402 - --- rtl/objpas/sysutils/sysstr.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rtl/objpas/sysutils/sysstr.inc b/rtl/objpas/sysutils/sysstr.inc index 95a7e4aab0..f87b827a81 100644 --- a/rtl/objpas/sysutils/sysstr.inc +++ b/rtl/objpas/sysutils/sysstr.inc @@ -939,6 +939,7 @@ Function TextToFloat(Buffer: PChar; Var Value; ValueType: TFloatValue): Boolean; Var E,P : Integer; S : String; + TempValue: extended; Begin S:=StrPas(Buffer); @@ -953,7 +954,11 @@ Begin S[P] := '.'; case ValueType of fvCurrency: - Val(S,Currency(Value),E); + begin + // needed for platforms where Currency = Int64 + Val(S,TempValue,E); + Currency(Value) := TempValue; + end; fvExtended: Val(S,Extended(Value),E); fvDouble: