Function Tedit_int.Datetostr(Date:string):string;
var month,day,year:string;
begin
day:=copy(date,9,2);
month:=copy(date,6,2);
year:=copy(date,3,2);
if (year>'1300') or (year<'1499') then
begin
case strtoint(month) of
1:month:='فروردين';
2:month:='ارديبهشت';
3:month:='خرداد';
4:month:='تير';
5:month:='مرداد';
6:month:='شهريور';
7:month:='مهر';
8:month:='آبان';
9:month:='آذر';
10:month:='دي';
11:month:='بهمن';
12:month:='اسفند';
end;
day:=numtost(day)+'م ';
day:=copy(day,3,length(day));
if (day=' سه م ') then
day:=' سوم ';
if (day=' بيست و سه م ')then
day:=' بيست و سوم ';
if (day=' سيم ')then
day:=' سي ام ';
if (text[2]='3') or (text[1]='3') then
year:='هزار و سيصد'+numtost(year);
if (text[2]='4') or (text[1]='4') then
year:='هزار و چهارصد'+numtost(year);
Datetostr:=day+month+' '+year;
end
else
text:='تاريخ نامعتبر است';
end;
function Tedit_int.numtost(Num: String):String;
var ntos:string;
begin
case strtoint(num) of
10: begin numtost:=' و ده'; Exit; end;
11: begin numtost:=' و يازده'; Exit; end;
12: begin numtost:=' و دوازده'; Exit; end;
13: begin numtost:=' و سيزده'; Exit; end;
14: begin numtost:=' و چهارده'; Exit; end;
15: begin numtost:=' و پانزده'; Exit; end;
16: begin numtost:=' و شانزده'; Exit; end;
17: begin numtost:=' و هفده'; Exit; end;
18: begin numtost:=' و هجده'; Exit; end;
19: begin numtost:=' و نوزده'; Exit; end;
end;
case strtoint(num[1]) of
0: ;
2: ntos:=' و بيست';
3: ntos:=' و سي';
4: ntos:=' و چهل';
5: ntos:=' و پنجاه';
6: ntos:=' و شصت';
7: ntos:=' و هفتاد';
8: ntos:=' و هشتاد';
9: ntos:=' و نود';
end;
if num[1]<>'1' then
case strtoint(num[2]) of
0: ;
1: ntos:=ntos+' و يک';
2: ntos:=ntos+' و دو';
3: ntos:=ntos+' و سه ';
4: ntos:=ntos+' و چهار';
5: ntos:=ntos+' و پنج';
6: ntos:=ntos+' و شش';
7: ntos:=ntos+' و هفت';
8: ntos:=ntos+' و هشت';
9: ntos:=ntos+' و نه';
end;
numtost:=ntos;
end;