Ver Mensaje Individual
  #6  
Antiguo 28-11-2010
fidel fidel is offline
Miembro
 
Registrado: mar 2005
Posts: 381
Reputación: 20
fidel Va por buen camino
Código Delphi [-]
  //controlar entrada solo números
  if ( StrScan('0123456789.,'+chr(7)+chr(8), Key) = nil ) then  Key := #0;
  //cambiar punto decimal por coma
    if key = '.' then key := ',';
  //controlar entrada una sola coma
  for i := 1 to length(Edit1.Text) do
    if ( copy(Edit1.Text,i,1) = ',' ) and not ( StrScan(',', Key) = nil ) then  Key := #0;
end;
Responder Con Cita