evento
en el evento key press puse :
(de cada descuento)
procedure TVentArt.Descuento2KeyPress(Sender: TObject; var Key: Char);
var
desc2,total,totaldescontado: real;
begin
If Key = #13 then
begin
Cerrar.SetFocus;
Descuento2.SetFocus;
total:=strtofloat(totventa.text);
desc2:=((strtofloat(descuento2.text))/100) + 1;
totaldescontado:=(total/ desc2);
totventa.Text:=floattostrF((totaldescontado),FFNumber,9,2);
end
else
If Key = #27 then
Descuento2.Clear
else
begin
if not (Key in ['0'..'9',#8]) then
Key := #0;
end;
end;
pero cuando la cantidad tiene un "," se pone loca la suma.
|