Ver Mensaje Individual
  #9  
Antiguo 13-09-2010
Avatar de Héctor Randolph
[Héctor Randolph] Héctor Randolph is offline
Miembro Premium
 
Registrado: dic 2004
Posts: 882
Reputación: 20
Héctor Randolph Va por buen camino
Hola a todos

Aunque ya está resuelto, solo quiero comentar otra forma de llegar al mismo resultado. Existe la función SetRoundMode en la unidad Math.

Esto es lo que pone la ayuda:

Cita:
Description

Call SetRoundingMode to specify how the FPU handles rounding issues. The rounding mode can be any of the following values:

Value Meaning

rmNearest Rounds to the closest value.
rmDown Rounds toward negative infinity.
rmUp Rounds toward positive infinity.
rmTruncate Truncates the value, rounding positive numbers down and negative numbers up.
Entonces puedes usarla de esta forma:

Código Delphi [-]
 SetRoundMode(rmUp);
 Memo1.Lines.Clear;
 Memo1.Lines.Add(FloatToStr(RoundTo(9.975,-2)));

Saludos
Responder Con Cita