Get KoolPHP UI with 30% OFF!

Decimal numbers in GridNumberColumn seem to be incorrectly formatted when passed to insert/update commands

Martin
I defined a GridNumberColum with 4 decimal places:
$column = new GridNumberColumn();
$column->HeaderText = "Discount%";
$column->DataField = "Discount";
$column->ReadOnly = false;
$column->Width = "50px";
$column->DecimalNumber = 4;
$grid->MasterTable->AddColumn($column);
I use it to enter a "discount" as a percentage fractional value. The @Discount variable is then given to the MySQLDataSource instance to insert and update commands:
$ds = new MySQLDataSource($mysql_resouce);
$ds->InsertCommand = "insert into Markup (Service_Code, Markup) values ('@SvcCode', @Discount / -100)";
$ds->UpdateCommand = "update Markup set Service_Code = '@SvcCode', Markup = @Discount / -100;
(The discount is stored as negative markup as a float value. The DB type is SIGNED FLOAT)
In versions 8.7, 8.5:
Nothing is stored into the database and the new value does not appear in the table. It looks like the @Discount variable passed to insert/update command is incorrectly formatted and it causes an SQL error.
In version 6.8:
The same code works fine.
Posted Mar 4, 2016 Kool