Ver Mensaje Individual
  #5  
Antiguo 31-01-2011
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
Maestro aqui te sobro un edit:
Cita:
Empezado por ecfisa Ver Mensaje
Código Delphi [-]
var
   ip, op, res:Real;
begin
 // función StrToFloat: convierte un string a punto flotante 
   ip:= StrToFloat(edit1.text);
   op:= StrToFloat(edit2.text);
   res:= ip + op;
// función FormatFloat: da un formato específico a un nro. punto flotante *)
   Label1.Caption:= Edit1.Text:= FormatFloat('0.00', res); // muestra el resultado con dos dígitos decimales '0.00'
Ahora que tal asi:
Código Delphi [-]
var
   ip, op, res:Real;
begin
 // función StrToFloat: convierte un string a punto flotante
   ip:= StrToFloat(edit1.text);
   op:= StrToFloat(edit2.text);
   res:= ip + op;
// función FormatFloat: da un formato específico a un nro. punto flotante *)
   Label1.Caption:= '$ ' + FormatFloat('0.00', res); // muestra el resultado con dos dígitos decimales '0.00'
Saludos
__________________
Siempre Novato
Responder Con Cita