Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 14-04-2008
Avatar de jirbert
jirbert jirbert is offline
Miembro
 
Registrado: nov 2007
Ubicación: Valencia-Venezuela
Posts: 60
Poder: 19
jirbert Va por buen camino
disculpa IKinGl tengo otra duda!! tengo otro campo.. el cual es el 'total' el seria = a precio + 9%


lo cual redacte asi
edit3.text:=edit1.text+edit2.text;

ejemplo

x = 250 + 22,5

250 + 22,5 = 272,5

x = 272,5


pero no hace eso, hace lo siguiente

x = 250 + 22,5

250 + 22,5 = 25022,5

x = 25022,5


disculpa la ignorancia!!

y gracias!! nuevamente...
Responder Con Cita
  #2  
Antiguo 14-04-2008
lKinGl lKinGl is offline
Miembro
 
Registrado: ago 2007
Posts: 333
Poder: 19
lKinGl Va por buen camino
Hmm lo que sucede es que tienes que hacer una conversión de tipo recuerda que los campos de los edits son tomados por defecto tipo caracter y sin la converión logicamente te hará lo siguiente:

1+2=12

para que no te de ese resultado tiene que ser así:

Código Delphi [-]
begin
edit3.text:=strtoint(edit1.text)+strtoint(edit2.text);
end;

espero te sirva!!
Responder Con Cita
  #3  
Antiguo 14-04-2008
Avatar de jirbert
jirbert jirbert is offline
Miembro
 
Registrado: nov 2007
Ubicación: Valencia-Venezuela
Posts: 60
Poder: 19
jirbert Va por buen camino
me arrojo un error

[Error] Unit5.pas(180): Incompatible types: 'String' and 'Integer'
Responder Con Cita
  #4  
Antiguo 14-04-2008
lKinGl lKinGl is offline
Miembro
 
Registrado: ago 2007
Posts: 333
Poder: 19
lKinGl Va por buen camino
¿Podrias mostrarme tu código?

asi podria ayudarte mejor!
Responder Con Cita
  #5  
Antiguo 14-04-2008
Avatar de jirbert
jirbert jirbert is offline
Miembro
 
Registrado: nov 2007
Ubicación: Valencia-Venezuela
Posts: 60
Poder: 19
jirbert Va por buen camino
Código:
procedure TForm5.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
 Var
iva,total:double;

begin
 if edit3.Text<>'' then
  begin
   total:=strtofloat(edit3.text);
   iva:=total*0.09;
   edit4.Text:=format('%f',[iva]);
   //edit5.text:=strtoint(edit3.text)+strtoint(edit4.text);
  end
 else edit4.Text:='';
end;
Responder Con Cita
  #6  
Antiguo 14-04-2008
lKinGl lKinGl is offline
Miembro
 
Registrado: ago 2007
Posts: 333
Poder: 19
lKinGl Va por buen camino
Código Delphi [-]
Var
iva,total:double;
n1,n2,nt:integer;
  begin
   total:=strtofloat(edit3.text);
   iva:=total*0.09;
   edit4.Text:=format('%f',[iva]);
   n1:=strtoint(edit3.text);
   n2:=strtoint(Edit4.text);
   nt:=n1+n2;
   edit5.Text:=format('%f',[nt]);//Usa este tipo de salida
   edit5.text:=inttostr(nt);//O esta Otra Salida
  end
end;

Saludos!
Responder Con Cita
  #7  
Antiguo 14-04-2008
Avatar de jirbert
jirbert jirbert is offline
Miembro
 
Registrado: nov 2007
Ubicación: Valencia-Venezuela
Posts: 60
Poder: 19
jirbert Va por buen camino
otro error probe con ambos y me dio el mismo error

Project project1.exe raised exception class EConvertError with message “13,49” is not a valid integer value’. Process stopped. Use step or to run to continue
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
calculo de porcentaje valiant_crps SQL 10 07-04-2008 08:16:52
formato porcentaje con DBGrid !!!! david_uh Varios 8 03-07-2007 18:36:47
Calculo del porcentaje con base en el total Patri Forero Impresión 2 27-11-2006 16:33:02
Porcentaje de uso del CPU OSKR C++ Builder 2 13-07-2006 01:23:53
Porcentaje en un ProgressBar silviodp OOP 1 15-04-2004 06:41:41


La franja horaria es GMT +2. Ahora son las 08:33:34.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi