Recent

Author Topic: [ SOLVED ] TsdfDataSet and DecimalSeperator  (Read 2067 times)

John Landmesser

  • New Member
  • *
  • Posts: 25
[ SOLVED ] TsdfDataSet and DecimalSeperator
« on: October 24, 2012, 04:10:16 pm »
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.Edit;
sdfDataSet1.Fields[DBGrid1.SelectedIndex].AsCurrency := 200.99;
becomes 200,99 as shown in the DBGrid, thats ok!!

But:
Var
 curr : currency;
begin
  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
...
« Last Edit: October 25, 2012, 08:58:15 am by JohnML »

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: TsdfDataSet and DecimalSeperator
« Reply #1 on: October 24, 2012, 04:17:26 pm »
Does DBGrid1.SelectedIndex return 1?

John Landmesser

  • New Member
  • *
  • Posts: 25
Re: TsdfDataSet and DecimalSeperator
« Reply #2 on: October 24, 2012, 04:26:24 pm »
it's only pseudo code, i edited my post.

Yes, DBGrid1.SelectedIndex returns the correct FieldIndex !

 

TinyPortal © 2005-2018