08-03-2015, 07:01 PM
السلام عليكم
أخي لدي برنامج فواتير ووجدت كود يكتب الارقام بالفرنسية
السؤال هو كيف أكتب الرقمين بعد الفاصلة على شكل أرقام وليس حروف
هذا هو الكودجزاك الله خيرا
أخي لدي برنامج فواتير ووجدت كود يكتب الارقام بالفرنسية
السؤال هو كيف أكتب الرقمين بعد الفاصلة على شكل أرقام وليس حروف
هذا هو الكود
كود :
Procedure TotalTTC_en_Lettre;
var
S,C, D, centimes, dinars, decimal : string;
cent:string[2];
//car : array [1..3] of string;
I : integer;
begin
//--------------------
centimes:=''; dinars:='';cent:='';
S:=Data.T_VentesTotal_TTC.AsString;
i:=0;// connaitre la position du separateur decimale
While not((S[i]=',') or(i > length(S))) do
begin
i:=i+1;
end;
C:=copy(S,i,1);
if C=',' then // s'il y a un nombre decimale
begin
D:=copy(S,1,(i-1));
dinars:=enLettres(StrToInt(d));
cent:=copy(S, i+1, (Length(S)-i));
if length(cent)=1 then cent:=cent+'0';
centimes:=' et'+enLettres(StrToInt(cent))+' Cts';
end
ELSE
begin
dinars:=enLettres(StrToInt(s));
centimes:=' et'+enLettres(0)+' Centimes';
end;