Tema: formula..
Ver Mensaje Individual
  #3  
Antiguo 20-01-2007
truequeman truequeman is offline
Miembro
 
Registrado: ene 2007
Posts: 26
Reputación: 0
truequeman Va por buen camino
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.
Responder Con Cita