Ver Mensaje Individual
  #3  
Antiguo 06-05-2019
bucanero bucanero is offline
Miembro
 
Registrado: nov 2013
Ubicación: Almería, España
Posts: 208
Reputación: 11
bucanero Va camino a la fama
hola a todos

prueba este código

Código Delphi [-]
function EspecialRound(const value: Currency): Currency;
begin
  Result := value / 1000;
  Result := TRUNC(TRUNC(Result) + Frac(Result) / 0.99) + 1;
  Result := 1000 * Result - 10;
end;

procedure TForm2.test;
const
  values: array[1..4] of Currency = (25430.25, 36751, 18950.45, 18992);
var
  i: LongInt;
begin
  for i := 1 to 4 do
    Memo1.Lines.Add(format('%m: %m', [values[i], EspecialRound(values[i])]));
end;

Un saludo
Responder Con Cita