عرض مشاركة واحدة
قديم 04-30-2008, 12:48 مساءً   #9 (permalink)
jamal_net
عضو جديد
 
تاريخ التسجيل: Apr 2008
المشاركات: 3
معدل تقييم المستوى: 6jamal_net يستاهل ترحيب
رد: سؤال عن الدالة التي تجعل الرقم كتابة

أخي هذه هي الدالة لكنها فرنسية حولها الى انجليزي ( غير اسماء الارقام من فرنسي الى انجليزي)

Function jam(pu)
'jamal_net

u_let = Array(" ", "Un", "Deux", "Trois", "Quatre", "Cinq", "Six", "Sept", "Huit", "Neuf", "Dix", "Onze", "Douze", "Treize", "Quatorze", "Quinze", "Seize", "Dix sept", "Dix huit", "Dix neuf", "Vingt", _
"Vingt et un", "Vingt deux", "Vingt trois", "Vingt quatre", "Vingt cinq", "Vingt six", "Vingt sept", "Vingt huit", "Vingt neuf", "Trente", "Trente et un", "Trente deux", "Trente trois", "Trente quatre", _
"Trente cinq", "Trente six", "Trente sept", "Trente huit", "Trente neuf", "Quarante", "Quarante et un", "Quarante deux", "Quarante trois", "Quarante quatre", "Quarante cinq", "Quarante six", "Quarante sept", _
"Quarante huit", "Quarante neuf", "Cinquante", "Cinquante et un", "Cinquante deux", "Cinquante trois", "Cinquante quatre", "Cinquante cinq", "Cinquante six", "Cinquante sept", "Cinquante huit", "Cinquante neuf", _
"Soixante", "Soixante et un", "Soixante deux", "Soixante trois", "Soixante quatre", "Soixante cinq", "Soixante six", "Soixante sept", "Soixante huit", "Soixante neuf", "Soixante dix", "Soixante et onze", "Soixante douze", _
"Soixante treize", "Soixante quatorze", "Soixante quinze", "Soixante seize", "Soixante dix sept", "Soixante dix huit", "Soixante dix neuf", "Quatre vingt", "Quatre vingt un", "Quatre vingt deux", "Quatre vingt trois", _
"Quatre vingt quatre", "Quatre vingt cinq", "Quatre vingt six", "Quatre vingt sept", "Quatre vingt huit", "Quatre vingt neuf", "Quatre vingt dix", "Quatre vingt onze", "Quatre vingt douze", "Quatre vingt treize", _
"Quatre vingt quatorze", "Quatre vingt quinze", "Quatre vingt seize", "Quatre vingt dix sept", "Quatre vingt dix huit", "Quatre vingt dix neuf")

enti = Int(pu)
DecI = Int((pu * 100 - enti * 100) + 0.01)
LonE = Len(enti)
LonD = Len(pu)
If DecI = 100 Then
enti = enti + 1
DecI = 0
End If
If DecI > 0 Then
Ct = (Trim(DecI) + " Cts")
Else
Ct = ""
End If

If LonE > 0 Then
If enti = 0 Then
jam = Ct
Else
Select Case LonE
Case 1
jam = (u_let(enti) + " DH " + Ct)
Case 2
jam = Trim(u_let(enti) + " DH " + Ct)
Case 3
c = Int(Val(Left(enti, 1)))
d = Int(Val(Right(enti, 2)))
If c = 1 Then
ch1 = ("Cent ")
Else
ch1 = (u_let(c) + " Cent ")
End If
ch2 = (u_let(d) + " DH ")
jam = Trim(ch1 + ch2 + Ct)
Case 4
m = Int(Val(Left(enti, 1)))
c = Int(Val(Left((enti - (m * 1000) - Val(Right(enti, 2))), 1)))
d = Int(Val(Right(enti, 2)))
If m = 1 Then
ch1 = ("Mille ")
Else
ch1 = (u_let(m) + " Mille ")
End If
If c = 0 Then
ch2 = ""
Else
If c = 1 Then
ch2 = (" Cent ")
Else
ch2 = (u_let(c) + " Cent ")
End If
End If
ch3 = (u_let(d) + " DH ")
jam = Trim(ch1 + ch2 + ch3 + Ct)

Case 5
m = Int(Val(Left(enti, 2)))
c = Int(Val(Left((enti - (m * 1000) - Val(Right(enti, 2))), 1)))
d = Int(Val(Right(enti, 2)))
ch1 = (u_let(m) + " Mille ")
If c = 0 Then
ch2 = ""
Else
If c = 1 Then
ch2 = (" Cent ")
Else
ch2 = (u_let(c) + " Cent ")
End If
End If
ch3 = (u_let(d) + " DH ")
jam = Trim(ch1 + ch2 + ch3 + Ct)
Case 6
n = Int(Val(Left(enti, 1)))
'Si ValEntière(ChaîneNum(Gauche((EntI - n * 100000); 2))) < 10000 Alors
m = Int(Val(Right(Left(enti, 3), 2)))
'Sinon
'm = ValEntière(ChaîneNum(Gauche((EntI - n * 100000); 2)))
'Fin Si
c = Int(Val(Left(enti - (n * 100000 + m * 1000 + Val(Right(enti, 2))), 1)))
d = Int(Val(Right(enti, 2)))
If n = 1 Then
ch0 = "Cent "
Else
ch0 = (u_let(n) + " Cent ")
End If
ch1 = (u_let(m) + " Mille ")

If c < 1 Then
ch2 = ""
Else
If c = 1 Then
ch2 = (" Cent ")
Else
ch2 = (u_let(c) + " Cent ")
End If
End If
ch3 = (u_let(d) + " DH ")
jam = Trim(ch0 + ch1 + ch2 + ch3 + Ct)
Case 7
ml = Int(Val(Left(enti, 1)))
n = Int(Val(Right(Left((enti), 2), 1)))
m = Int(Val(Left((enti - ml * 1000000 - n * 100000), 2)))
c = Int(Val(Left((enti - (ml * 1000000 + n * 100000 + m * 1000 + Val(Right(enti, 2)))), 1)))
d = Int(Val(Right(enti, 2)))
reste = enti Mod 1000000
If reste <= 0 Then
chml = u_let(ml) + " million de"
Else
chml = u_let(ml) + " million "
End If
If n = 0 Then
ch0 = ""
Else
If n = 1 Then
ch0 = " Cent "
Else
ch0 = (u_let(n) + " Cent ")
End If
End If
If m = 0 Then
ch1 = ""
Else
ch1 = (u_let(m) + " Mille ")
End If
If c = 0 Then
ch2 = ""
Else
If c = 1 Then
ch2 = (" Cent ")
Else
ch2 = (u_let(c) + " Cent ")
End If
End If
If d = 0 Then
ch3 = " DH "
Else
ch3 = (u_let(d) + " DH ")
End If
jam = Trim((chml + ch0 + ch1 + ch2 + ch3 + Ct))
End Select
End If
Else
jam = Ct
End If
End Function
Function Jamal(pu)
Jamal = "Arrêté à la somme de :" + (jam(pu))
End Function
Function tit(en_tite)
Select Case en_tite
Case 1
tit = "ROYUAME DU MAROC"
Case 2
tit = "PROVINCE D'ESSAOUIRA"
Case 3
tit = "PACHALIK AIT DAOUD"
Case 4
tit = "COMMUNE URBAINE AIT DAOUD"
End Select
End Function
Function rub(fff)
Select Case fff
Case 1
rub = "INDEMNITES AU PRESIDENT ET AUX CONSEILLERS Y AYANT DROIT"
Case 2
rub = "TRAITEMENT ET INDEMNITES PERMANENTES DU PERSONNEL TITULAIRE ET ASSIMILES"
Case 3
rub = "SALAIRES ET INDEMNITES PERMANENTES DU PERSONNEL TEMPORAIRE"
Case 4
rub = " Participation Patronale a la caisse mrocaine de retraité (CMR) "
Case 5
rub = "Participation Patronnale regime collectif d'allocation de retraité (RCAR)"
Case 6
rub = "Participations Patronales Aux Organismes de Prevoyance Sociale ( CNOPS) "
End Select
End Function


أي سؤال انا في الخدمة





من مواضيع jamal_net في المنتدى
    jamal_net غير متواجد حالياً   رد مع اقتباس