Az alábbi függvény szöveggé alakítja a megadott számot:

function TfrmMain.IntToHunAlpha(Number: longint): string;
const
Ones: array[0..9] of string[10] = ('', 'egy', 'kettő', 'három', 'négy', 'öt', 'hat', 'hét', 'nyolc', 'kilenc'); 
Tens: array[0..9] of string[10] = ('', 'tíz', 'húsz', 'harminc', 'negyven', 'ötven', 'hatvan', 'hetven', 'nyolcvan', 'kilencven'); 
var
   Num: string;
   Group: string[3];
   X,Y,Z: integer;
   PN: longint;
   First: string[1];
function ToThousand(Group: string): string;
var
   Space: string[3];
begin
   Result := '';
   Space := ' ';
   insert(Group, Space, 4 - length(Group));
   Group := Space;
   if Group[1] <> ' ' then if Group[1] <> '0' then
   Result := Ones[StrToInt(Group[1])] + 'száz';
   if Group[2] <> ' ' then if Group[2] <> '0' then 
   begin
     case StrToInt(Group[2]) of
       1: if Group[3] <> '0' then Result := Result + 'tizen'
       else Result := Result + 'tíz';
       2: if Group[3] <> '0' then Result := Result + 'huszon'
       else Result := Result + 'húsz';
       else Result := Result + Tens[StrToInt(Group[2])];
     end;
   end;
   Result := Result + Ones[StrToInt(Group[3])];
end;
begin
   PN := Abs(Number);
   if Number = 0 then Result := 'Nulla'
   else
     begin
       Result := '';
       X := 0;
       Num := IntToStr(PN);
       while X * 3 < length(Num) do
         begin
         Y := length(Num) + 1- (X + 1) * 3;
         Z := 3;
         if Y < 1 then 
          begin
           Y := 1;
           Z := length(Num) mod 3;
           if Z = 0 then Z := 3;
          end;
       Group := copy(Num, Y, Z);
       if StrToInt(Group) <> 0 then
         begin
           case X of
           0: Result := ToThousand(Group);
           1: if PN @#62 2000 then Result := ToThousand(Group) + 'ezer-' + Result
           else Result := ToThousand(Group) + 'ezer' + Result;
           2: Result := ToThousand(Group) + 'millió-' +Result;
           3: Result := ToThousand(Group) + 'milliárd-' +Result;
           end;
         end;
       inc(X);
     end;
     if Number < 0 then Result := 'mínusz ' + Result;
       First := AnsiUpperCase(Result[1]);
       Result[1] := First[1];
       if Result[length(Result)] = '-' then
       Result := copy(Result, 1, length(Result) - 1);
     end;
end;