تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
Function لتحويل الارقام الى كلمات
#1
PHP كود :
Public Function Horof(X)
      
Ma " ريال"
      
Mi " هللة"
      
Int(X)
      
Val(Right(Format(X"000000000000.00"), 2))
      
SHorof(N)
      If 
<> "" And 0 Then Result Ma " و " Mi
      
If <> "" And 0 Then Result Ma
      
If "" And <> 0 Then Result Mi
      Horof 
Result
      
End 
Function

Private Function 
SHorof(X)
      
      
Int(X)
      
Format(N"000000000000")
      
C1 Val(Mid(C121))
      
Select Case C1
            
Case Is 1Letter1 "واحد"
            
Case Is 2Letter1 "اثنان"
            
Case Is 3Letter1 "ثلاثة"
            
Case Is 4Letter1 "اربعة"
            
Case Is 5Letter1 "خمسة"
            
Case Is 6Letter1 "ستة"
            
Case Is 7Letter1 "سبعة"
            
Case Is 8Letter1 "ثمانية"
            
Case Is 9Letter1 "تسعة"
      
End Select
      
      C2 
Val(Mid(C111))
      
Select Case C2
            
Case Is 1Letter2 "عشر"
            
Case Is 2Letter2 "عشرون"
            
Case Is 3Letter2 "ثلاثون"
            
Case Is 4Letter2 "اربعون"
            
Case Is 5Letter2 "خمسون"
            
Case Is 6Letter2 "ستون"
            
Case Is 7Letter2 "سبعون"
            
Case Is 8Letter2 "ثمانون"
            
Case Is 9Letter2 "تسعون"
      
End Select
      
      
If Letter1 <> "" And C2 1 Then Letter2 Letter1 " و" Letter2
      
If Letter2 "" Then Letter2 Letter1
      
If C1 And C2 1 Then Letter2 Letter2 "ة"
      
If C1 And C2 1 Then Letter2 "احدى عشر"
      
If C1 And C2 1 Then Letter2 "اثنى عشر"
      
If C1 And C2 1 Then Letter2 Letter1 " " Letter2
      C3 
Val(Mid(C101))
      
Select Case C3
            
Case Is 1Letter3 "مائة"
            
Case Is 2Letter3 "مئتان"
            
Case Is 2Letter3 Left(SHorof(C3), Len(SHorof(C3)) - 1) + "مائة"
      
End Select
      
If Letter3 <> "" And Letter2 <> "" Then Letter3 Letter3 " و" Letter2
      
If Letter3 "" Then Letter3 Letter2
      
      C4 
Val(Mid(C73))
      
Select Case C4
            
Case Is 1Letter4 "الف"
            
Case Is 2Letter4 "الفان"
            
Case 3 To 10Letter4 SHorof(C4) + " آلاف"
            
Case Is 10Letter4 SHorof(C4) + " الف"
      
End Select
      
If Letter4 <> "" And Letter3 <> "" Then Letter4 Letter4 " و" Letter3
      
If Letter4 "" Then Letter4 Letter3
      C5 
Val(Mid(C43))
      
Select Case C5
            
Case Is 1Letter5 "مليون"
            
Case Is 2Letter5 "مليونان"
            
Case 3 To 10Letter5 SHorof(C5) + " ملايين"
            
Case Is 10Letter5 SHorof(C5) + " مليون"
      
End Select
      
If Letter5 <> "" And Letter4 <> "" Then Letter5 Letter5 " و" Letter4
      
If Letter5 "" Then Letter5 Letter4
      
      C6 
Val(Mid(C13))
      
Select Case C6
            
Case Is 1Letter6 "مليار"
            
Case Is 2Letter6 "ملياران"
            
Case Is 2Letter6 SHorof(C6) + " مليار"
      
End Select
      
If Letter6 <> "" And Letter5 <> "" Then Letter6 Letter6 " و" Letter5
      
If Letter6 "" Then Letter6 Letter5
      SHorof 
Letter6
      
End 
Function 


ان شاء الله الكل يستفيد منها
الرد }}}
تم الشكر بواسطة: محمد الشادلى رحومة
#2
وهذا كود بحث باكثر من طريقة والجمع بالارقام واظهارها بالحروف بجانب الارقام (( عبر label وعددهم 11 label))
PHP كود :
Private Sub Command1_Click()

Dim b   As String
" هذا أجمالي السحب لجميع الموظفين "
Select Case Combo1.ListIndex
Case 0
Adodc1
.RecordSource "select *from stor where no_job=" Val(Text1.Text)
Adodc1.Refresh
Adodc2
.RecordSource "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where no_job=" Val(Text1.Text)
Adodc2.Refresh
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then

S1 
Horof(Text3.Text)
S2 Horof(Text2.Text)
S3 Horof(Text7.Text)
S4 Horof(Text8.Text)
S5 Horof(Text9.Text)
S6 Horof(Text10.Text)
S7 Horof(Text13.Text)
S8 Horof(Text11.Text)
S9 Horof(Text4.Text)
S10 Horof(Text5.Text)
S11 Horof(Text6.Text)
Else
S1.Caption "صفر ريال"
S2.Caption "صفر ريال"
S3.Caption "صفر ريال"
S4.Caption "صفر ريال"
S5.Caption "صفر ريال"
S6.Caption "صفر ريال"
S7.Caption "صفر ريال"
S8.Caption "صفر ريال"
S9.Caption "صفر ريال"
S10.Caption "صفر ريال"
S11.Caption "صفر ريال"

End If

Case 
1
Adodc1
.RecordSource "select *from stor where name=  '" Text1.Text "'"
Adodc1.Refresh
Adodc2
.RecordSource "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where name=  '" Text1.Text "'"
Adodc2.Refresh
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then

S1 
Horof(Text3.Text)
S2 Horof(Text2.Text)
S3 Horof(Text7.Text)
S4 Horof(Text8.Text)
S5 Horof(Text9.Text)
S6 Horof(Text10.Text)
S7 Horof(Text13.Text)
S8 Horof(Text11.Text)
S9 Horof(Text4.Text)
S10 Horof(Text5.Text)
S11 Horof(Text6.Text)
Else
S1.Caption "صفر ريال"
S2.Caption "صفر ريال"
S3.Caption "صفر ريال"
S4.Caption "صفر ريال"
S5.Caption "صفر ريال"
S6.Caption "صفر ريال"
S7.Caption "صفر ريال"
S8.Caption "صفر ريال"
S9.Caption "صفر ريال"
S10.Caption "صفر ريال"
S11.Caption "صفر ريال"

End If
Case 
2
Adodc1
.RecordSource "select *from stor where no_bil=" Val(Text1.Text)
Adodc1.Refresh
Adodc2
.RecordSource "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where no_bil=" Val(Text1.Text)
Adodc2.Refresh
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then

S1 
Horof(Text3.Text)
S2 Horof(Text2.Text)
S3 Horof(Text7.Text)
S4 Horof(Text8.Text)
S5 Horof(Text9.Text)
S6 Horof(Text10.Text)
S7 Horof(Text13.Text)
S8 Horof(Text11.Text)
S9 Horof(Text4.Text)
S10 Horof(Text5.Text)
S11 Horof(Text6.Text)
Else
S1.Caption "صفر ريال"
S2.Caption "صفر ريال"
S3.Caption "صفر ريال"
S4.Caption "صفر ريال"
S5.Caption "صفر ريال"
S6.Caption "صفر ريال"
S7.Caption "صفر ريال"
S8.Caption "صفر ريال"
S9.Caption "صفر ريال"
S10.Caption "صفر ريال"
S11.Caption "صفر ريال"

End If
Case 
3
Adodc1
.RecordSource "select *from stor where on_Card=" Val(Text1.Text)
Adodc1.Refresh
Adodc2
.RecordSource "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where on_Card=" Val(Text1.Text)
Adodc2.Refresh
Text14
.Text Text14.Text Text1.Text
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then

S1 
Horof(Text3.Text)
S2 Horof(Text2.Text)
S3 Horof(Text7.Text)
S4 Horof(Text8.Text)
S5 Horof(Text9.Text)
S6 Horof(Text10.Text)
S7 Horof(Text13.Text)
S8 Horof(Text11.Text)
S9 Horof(Text4.Text)
S10 Horof(Text5.Text)
S11 Horof(Text6.Text)
Else
S1.Caption "صفر ريال"
S2.Caption "صفر ريال"
S3.Caption "صفر ريال"
S4.Caption "صفر ريال"
S5.Caption "صفر ريال"
S6.Caption "صفر ريال"
S7.Caption "صفر ريال"
S8.Caption "صفر ريال"
S9.Caption "صفر ريال"
S10.Caption "صفر ريال"
S11.Caption "صفر ريال"

End If
Case 
4

Adodc1
.RecordSource "select *from stor;"
Adodc1.Refresh
Adodc2
.RecordSource "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor;"
Adodc2.Refresh
Text14
.Text b
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then

S1 
Horof(Text3.Text)
S2 Horof(Text2.Text)
S3 Horof(Text7.Text)
S4 Horof(Text8.Text)
S5 Horof(Text9.Text)
S6 Horof(Text10.Text)
S7 Horof(Text13.Text)
S8 Horof(Text11.Text)
S9 Horof(Text4.Text)
S10 Horof(Text5.Text)
S11 Horof(Text6.Text)
Else
S1.Caption "صفر ريال"
S2.Caption "صفر ريال"
S3.Caption "صفر ريال"
S4.Caption "صفر ريال"
S5.Caption "صفر ريال"
S6.Caption "صفر ريال"
S7.Caption "صفر ريال"
S8.Caption "صفر ريال"
S9.Caption "صفر ريال"
S10.Caption "صفر ريال"
S11.Caption "صفر ريال"

End If

End Select

End Sub 
الرد }}}
تم الشكر بواسطة: محمد الشادلى رحومة
#3
بارك الله فيك وجزاك خيراً
سبحان الله وبحمده سبحان الله العظيم
آللهم لگ آلحمد حتى ترضى .. ولگ آلحمد إذا رضيِت .. ولگ آلحمد بعد آلرضآ
الرد }}}
تم الشكر بواسطة:
#4
شكرا لك
يعطيك العافية اخوي

و تقبل مروري البسيط
الرد }}}
تم الشكر بواسطة:
#5
hago كتب :بارك الله فيك وجزاك خيراً
يسلموا على المرور اخي hago
tourra كتب :شكرا لك
يعطيك العافية اخوي

و تقبل مروري البسيط
يسلموا على المرور الجميل
الرد }}}
تم الشكر بواسطة:
#6
شكرا لكم   ......    جهد مشكور وبالتوفيق بمشيئة الله وعونه        متولى المغربى
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  تفقيط الارقام ( تحويل الأرقام 123 إلى مائة وثلاث وعشرون ) RaggiTech 0 3,524 17-10-12, 12:41 AM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم