المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : التفقيط بالفرنسي


احمد احماني
15-10-2014, 11:42 AM
السلام عليكم جميعا اعضاء ومشريفي المنتدى
اتمنى ممن لديه الخبرة في مساعدتي في كيفية تحويل الارقام الى حروف فرنسية
على سبيل 123 يتم تحويله الى:"cent vingt trois"
او بالاحرى هل توجد اضافة تقوم بالمهمة على غرار الاضافة التي تقدم بها مشكورا الاخ النصل القاطع
وللجميع التحية

ثامر أبو بلقيس
15-10-2014, 12:52 PM
السلام عليكم ورحمة الله وبركاته
في global functions ضع
function chiffretolettre(montant)
if montant == 0 then
numToLettre = " "
end
Unites = {"Zero", "Un", "Deux", "Trois", "Quatre", "Cinq", "Six", "Sept", "Huit", "Neuf"}
Dizaines = {"", "Dix", "Vingt", "Trente", "Quarante", "Cinquante", "Soixante", "Soixante", "Quatre-Vingt", "Quatre-Vingt"}
Dixtaines = {"Dix", "Onze", "Douze", "Treize", "Quatorze", "Quinze", "Seize", "Dix-sept", "Dix-Huit", "Dix-Neuf"}
if montant >= 100 then
NbCent = Math.Floor(montant / 100);
NbCent = NbCent + 1;
resultat = Unites[NbCent]
if (NbCent-1) == 0 then
numToLettre = ""
elseif (NbCent-1) == 1 then
numToLettre = "Cent"
else
numToLettre = resultat .. " Cent"
end
montant = montant - ((NbCent-1) * 100)
else
numToLettre = ""
end
if montant > 10 and montant < 20 then
Nbdit = montant - 9
resultat = Dixtaines[Nbdit]
numToLettre = numToLettre .. " " .. resultat
montant = 0
end
if montant >= 10 then
Nbdix = (Math.Floor(montant / 10))+1
resultat = Dizaines[Nbdix]
numToLettre = numToLettre .. " " .. resultat
montant = montant - ((Nbdix-1) * 10)
if (Nbdix-1) == 9 or (Nbdix-1) == 7 then
NB7x = montant + 1
resultat = Dixtaines[NB7x]
numToLettre = numToLettre .. " " .. resultat
montant = 0
end
if montant == 1 then
numToLettre = numToLettre.." et ";
end
end
if montant > 0 and montant < 10 then
NB00x = montant + 1;
resultat = Unites[NB00x]
numToLettre = numToLettre .. " " .. resultat
end
end
function arretation(montant)
denominat = {"Dinars", "Mille", "Million", "Milliard", "Billion"}
divizeur = {1, 1000, 1000000, 1000000000, 1000000000000}
centieme = Math.Round((montant - (Math.Floor(montant))) * 100, 0)
montant = Math.Floor(montant)
multiple = Math.Floor(String.Length(montant) / 3)
if Math.Mod((String.Length(montant)), 3) >= 1 then
multiple = multiple + 1
end
for i = multiple, 1, -1 do
if next then
montant = Math.Floor(montant)
multiple = Math.Floor(String.Length(montant) / 3)
if Math.Mod((String.Length(montant)), 3) >= 1 then
multiple = multiple + 1
end
end
if multiple == i then
partichifr = Math.Floor(montant / (divizeur[multiple]))
if multiple == 2 and partichifr == 1 then
natidja = ""
else
chiffretolettre(partichifr)
natidja = numToLettre
end
arretat = arretat.." ".. natidja .. " " .. denominat[multiple]
montant = montant - (partichifr * divizeur[multiple])
next = true
end
if multiple == 1 then
if centieme > 0 then
centieme = Math.Round(centieme, 2);
if centieme == 1 then
arretat = arretat .. " et " .. centieme .. " Centime."
else
arretat = arretat .. " et " .. centieme .. " Centimes."
end
else
arretat = arretat .. ""
end
end
end
if arretat == " Dinars." then
arretat = ""
end
montant = arretat
return montant;
end

ضمن مشروعك Input1 و عنصر Paragraph1
وزر ازرع فيه
arretat = ""
numToLettre = ""
next = false

num = Input.GetText("Input1")
if montant ~= "" then
montant = String.ToNumber(num)
Paragraph.SetText("Paragraph1", arretation(montant))
end

--------- أكتب الان في الانبوت اضغط على الزر عاين النتائج في Paragraph
:abc_138:

احمد احماني
15-10-2014, 01:11 PM
حقيقة انا عاجز عن الطريقة التي استطيع ان اشكرك اخي تامر عن المساعدة العاجلة هذه
شـكــ وبارك الله فيك ـــرا لك ... لك مني أجمل تحية .

ثامر أبو بلقيس
15-11-2014, 07:17 PM
موفق بإذن الله ... لك مني أجمل تحية . :abc_138:

منوبة
22-09-2015, 01:59 PM
راااااااااااااااااااااااا اااااااااااائع يا ابا بلقيس
جعلك الله من اهل الجنّة انت ومن تحب
:abc_152::abc_152: