Here is the code for the total price that is giving the floating-point error ':
//Pr. Total
sgItens.Cells[5,l] := FormatFloat('###,###,###,##0.00',StrToFloat(copy(lTemp, 210, 14)));
cont:= StrToFloat(sgItens.Cells[5,l]);
valorTotal:= valorTotal+cont;
I'm trying to get a certain value to get troco
of subtraction of two variables:
Here is the code for the Paid value :
//Valor Pago
sgFinalizadoras.Cells[3,l] := FormatFloat('##,###,##0.00',StrToFloat(copy(lTemp, 80, 13)));
valorPago:= StrToFloat(copy(lTemp, 80, 13));
And just below the code to perform the subtraction, in the case would be the mathematical function of change and some of the lines of StringGrid
, this is giving floating point error:
//Troco
troco:= valorPago - valorTotal;
Edit2.Text := FormatFloat('##,###,##0.00',troco);
What would I be wrong about?