![]() |
|
كيف أكتب الرقمين بعد الفاصلة على شكل أرقام وليس حروف - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : كيف أكتب الرقمين بعد الفاصلة على شكل أرقام وليس حروف (/showthread.php?tid=6853) |
كيف أكتب الرقمين بعد الفاصلة على شكل أرقام وليس حروف - tahri - 08-03-2015 السلام عليكم أخي لدي برنامج فواتير ووجدت كود يكتب الارقام بالفرنسية السؤال هو كيف أكتب الرقمين بعد الفاصلة على شكل أرقام وليس حروف هذا هو الكود كود : 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; |