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