kullandığım fonksiyon:
Kod: Tümünü seç
function SayiToSozlu (Number :Double):String;
var
Text :Array [0..9,0..1] of String;
Sy,
Syt,
S :String;
function Oku(Deg:String):String;
var
B1,B2,B3:String;
P:Integer;
begin
try
B1 := Text[strToInt(copy(Deg, 3, 1)), 0];
B2 := Text[strToInt(Copy(Deg, 2, 1)), 1];
P := strToInt(Copy(Deg, 1, 1));
except
end;
if P > 1 then
b3 := Text[P, 0] + 'Yüz'
else if P = 1 then
b3 := 'Yüz'
else b3 := '';
Oku := b3 + B2 + B1;
end;
begin
Text[0, 0] :='';
Text[1, 0] := 'Bir';
Text[2, 0] := 'İki';
Text[3, 0] := 'Üç';
Text[4, 0] := 'Dört';
Text[5, 0] := 'Beş';
Text[6, 0] := 'Altı';
Text[7, 0] := 'Yedi';
Text[8, 0] := 'Sekiz';
Text[9, 0] := 'Dokuz';
Text[1, 1] := 'On';
Text[2, 1] := 'Yirmi';
Text[3, 1] := 'Otuz';
Text[4, 1] := 'Kırk';
Text[5, 1] := 'Elli';
Text[6, 1] := 'Altmış';
Text[7, 1] := 'Yetmiş';
Text[8, 1] := 'Seksen';
Text[9, 1] := 'Doksan';
if Number<=0 then
begin
Result:='';
exit;
end;
S := FormatFloat('0',Number);
S:='000000000000000' + S;
S := copy(S,length(s)-14,15);
Sy := '';
syt := '';
{Boluk$ := MID$(S$, 13, 3): Bolok Boluk$, Sy$, Text$()}
syt := Oku(copy(S, 13, 3));
if Oku(copy(S, 10, 3)) <> '' then
if strToInt(copy(S, 10, 3)) = 1 then
syt := 'Bin' +Syt
else
syt := Oku(copy(S, 10, 3))+'Bin' +Syt;
if Oku(copy(S, 7, 3)) <> '' then
syt := Oku(copy(S, 7, 3))+'Milyon' + Syt;
if Oku(copy(S, 4, 3)) <> '' then
syt := Oku(copy(S, 4, 3))+'Milyar' + Syt;
if Oku(copy(S, 1, 3)) <> '' then
syt := Oku(copy(S, 7, 3))+'Trilyon' + Syt;
SayiToSozlu := syt;
end;