Forum > Packages and Libraries

[ SOLVED ] TsdfDataSet and DecimalSeperator


John Landmesser:
Sorry, false alarm  :-[

i load a csv file that contains the currency symbol for EURO and thats no problem of TsdfDataset. That is bullshit in csv format !!

original post:

The system DecimalSeparator is a comma: ','

In Lazarus ShowMessage(DecimalSeparator) shows me the comma !

.. and now the problem with sdfDataSet:

sdfDataSet1.Fields[DBGrid1.SelectedIndex].AsCurrency := 200.99;
becomes 200,99 as shown in the DBGrid, thats ok!!

 curr : currency;
  Curr := SdfDataSet1.Fields[DBGrid1.SelectedIndex].AsCurrency // -> 200,99

 raises an EConvertError

Is that a problem of Freepascal because AsCurrency is defined in db.pas ??

db.pas line 331 : function GetAsFloat: Double; virtual;

So "Double" is the trouble maker ??

Lazarus 1.1 r39148 FPC 2.6.1 i386-win32-win32/win64

Does DBGrid1.SelectedIndex return 1?

John Landmesser:
it's only pseudo code, i edited my post.

Yes, DBGrid1.SelectedIndex returns the correct FieldIndex !


[0] Message Index

Go to full version