Ver Mensaje Individual
  #13  
Antiguo 07-12-2017
Avatar de The Cid James
The Cid James The Cid James is offline
Miembro
NULL
 
Registrado: jun 2013
Posts: 129
Reputación: 11
The Cid James Va por buen camino
uff a cambiar los tipos de la tabla para poder cambiar eso ya que puse el ejemplo solo enteros, pero tambien estoy usando monedas, ahora entiendo porque no me deja copilarlo, entonces la variable amount en el ejemplo que me pasaste tambien tendria que ser flotante?

Saludos

Edit :

Asi funciona bien con decimales

Código Delphi [-]
procedure TFcaja.EditsChange(Sender: TObject);
var
  amount: Currency;
begin
  amount := StrToFloatDef (E1.Text, 0) * 0.1 +   //  1 u$S
            StrToFloatDef(E5.Text, 0) *  5 + //  5 u$s
            StrToFloatDef(E10.Text, 0) * 10+ // 10 u$s
            StrToFloatDef(E2 .Text, 0) * 20 ;// + // 20 u$s
            //...
  EACtotal.Text:= FloatToStr (amount);
end;
__________________
We are told to remember the idea, not the man, because a man can fail. He can be caught, he can be killed and forgotten, but 400 years later, an idea can still change the world.

Última edición por The Cid James fecha: 07-12-2017 a las 01:44:26.
Responder Con Cita