I have this update query in laravel where I subracted a value to a total_qty column with a double datatype. Example: When 250 is subtracted by 15.1 the result should be 234.9 but in the total_qty with a double datatype column, it stored 234.4. What is wrong with this?
Update Query
InventoryRecord::where('id', $dataSales[$i]['sales_inv_id'])
->update(['total_qty' => $dataSales[$i]['actual_inv_quantity']-$dataSales[$i]['sales_qty']]);