Browse Source

* Money-types are stored as int64 by postgres
* Use a dot as decimalseparator while generating test-data for currencies

git-svn-id: trunk@12572 -

joost 16 years ago
parent
commit
7a8a249687

+ 1 - 1
packages/fcl-db/src/sqldb/postgres/pqconnection.pp

@@ -768,7 +768,7 @@ begin
         ftCurrency  :
           begin
           dbl := pointer(buffer);
-          dbl^ := BEtoN(PInteger(CurrBuff)^) / 100;
+          dbl^ := BEtoN(PInt64(CurrBuff)^) / 100;
           end;
         ftBoolean:
           pchar(buffer)[0] := CurrBuff[0]

+ 5 - 2
packages/fcl-db/tests/toolsunit.pas

@@ -235,9 +235,12 @@ begin
     testValues[ftSmallint,i] := IntToStr(testSmallIntValues[i]);
     testValues[ftInteger,i] := IntToStr(testIntValues[i]);
     testValues[ftLargeint,i] := IntToStr(testLargeIntValues[i]);
-    DecimalSeparator:=',';
-    testValues[ftCurrency,i] := CurrToStr(testCurrencyValues[i]);
+    // The decimalseparator was set to a comma for currencies and to a dot for ftBCD values.
+    // But why is not clear to me. For Postgres it works now, with a dot for both types.
+    // DecimalSeparator:=',';
     DecimalSeparator:='.';
+    testValues[ftCurrency,i] := CurrToStr(testCurrencyValues[i]);
+    // DecimalSeparator:='.';
     testValues[ftBCD,i] := CurrToStr(testCurrencyValues[i]);
     end;