1 (edited by mathmathou 2017-03-21 01:53:47)

Topic: MVD 3.3 - change in FormatFloat function ?

Hello Dmitry,


Did you change something regarding the FormatFloat function ?

This code :

begin
    for r := 0 to stats.TableGrid1.RowCount - 1 do
        begin
            stats.TableGrid1.Cells[1,r] := FormatFloat('#,##0', StrToFloat(stats.TableGrid1.Cells[1,r]));
            stats.TableGrid1.Cells[2,r] := FormatFloat('#,##0.00', StrToFloat(stats.TableGrid1.Cells[2,r]));
        end;
    stats.TableGrid1.Columns[2].Footer.Caption :=  FormatFloat('#,##0.00', stats.TableGrid1.Columns[2].Footer.FormulaValue);
end;

worked with version 3.2 but produces and error "The number X is not a valid floating point value' with version 3.3


Just to let you known.


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: MVD 3.3 - change in FormatFloat function ?

Hello.


There is no changes in the function FormatFloat, but there is some changes in the TableGrid.
Please attach your project, I will test.

Dmitry.

3 (edited by prahousefamily 2017-03-22 06:28:01)

Re: MVD 3.3 - change in FormatFloat function ?

Error '' is not a valid floating point value
and  after show error score bar up down in table grid hide ???


I edit script in text change for sql execute in tablegrid but  i try mvd 3.3 show error
and score bar have't show  help me please !

    IF  text_special.Edit1.Text <> ''
    Then
    text_special.TableGrid1.dbSQL :=
    'SELECT * FROM test.mvd_project_text_special WHERE test.mvd_project_text_special.text_special_code REGEXP '+
    'replace(trim("'+text_special.Edit1.Text +'")," ","|")'
    Else
    text_special.TableGrid1.dbSQL :=
    'SELECT * FROM test.mvd_project_text_special WHERE test.mvd_project_text_special.text_special_code LIKE '+
    '"%'+text_special.Edit1.Text +'%"';
    text_special.TableGrid1.dbSQLExecute ;

But when restore version 3.2 compile not error normal

Post's attachments

Attachment icon 2017-03-22 11 52 04.png 24.64 kb, 23 downloads since 2017-03-22 

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: MVD 3.3 - change in FormatFloat function ?

prahousefamily
Please send me your project to support@drive-software.com with link on this topic

Dmitry.

Re: MVD 3.3 - change in FormatFloat function ?

Hello Dmitry,


Sorry it took me some time to answer.


I've uploaded the whole project to Mega  (because it's 21 Mo, the database is huge) and sent you the link by mail at support@drive-software.com with instructions to reproduce the error message.


Thank you very much


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: MVD 3.3 - change in FormatFloat function ?

mathmathou
Insted this procedure

//-02- FORMATING CELLS IN TABELGRID1
procedure stats_Button1_OnAfterClick (Sender: string);
var
    r : Integer;
    nb_known, nb_owned : Integer;
    value_known, value_owned : Extended;
begin
    for r := 0 to stats.TableGrid1.RowCount - 1 do
        begin
            stats.TableGrid1.Cells[1,r] := FormatFloat('#,##0', StrToFloat(stats.TableGrid1.Cells[1,r]));
            stats.TableGrid1.Cells[2,r] := FormatFloat('#,##0.00', StrToFloat(stats.TableGrid1.Cells[2,r]));
        end;
    stats.TableGrid1.Columns[2].Footer.Caption :=  FormatFloat('#,##0.00', stats.TableGrid1.Columns[2].Footer.FormulaValue);

end;

please use it:

procedure stats_TableGrid1_OnChange (Sender: string);
begin
  if stats.TableGrid1.Columns[1] is TNxNumberColumn then
  begin
      TNxNumberColumn(stats.TableGrid1.Columns[1]).FormatMask := '#,##0';
      TNxNumberColumn(stats.TableGrid1.Columns[1]).Footer.FormatMask := '#,##0';
  end;

  if stats.TableGrid1.Columns[2] is TNxNumberColumn then
  begin
      TNxNumberColumn(stats.TableGrid1.Columns[2]).FormatMask := '#,##0.00';
      TNxNumberColumn(stats.TableGrid1.Columns[2]).Footer.FormatMask := '#,##0.00';
  end;
end;
Dmitry.

Re: MVD 3.3 - change in FormatFloat function ?

Again my savior !!


Thanks a million times Dmitry smile


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor