PercentsOf function
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
function PercentsOf(Entire, Part: Extended): Byte;  

Description
The PercentsOf procedure calculates the number of percents which contains the Part parameter in Entire parameter.  

Original code
function PercentsOf(Entire, Part: Extended): Byte;  
begin  
  Result := 0;  
  if Entire <> 0 then  
   try  
     Result := Round(Part * 100 / Entire);  
   except  
   end;  
end;