Terbilang function for Delphi