منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
كتابة الارقام بالحروف - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغات البرمجة الاخرى (http://vb4arb.com/vb/forumdisplay.php?fid=4)
+--- قسم : قسم لغة vb6.0 (http://vb4arb.com/vb/forumdisplay.php?fid=18)
+---- قسم : قسم أسئلة vb6.0 (http://vb4arb.com/vb/forumdisplay.php?fid=28)
+---- الموضوع : كتابة الارقام بالحروف (/showthread.php?tid=49577)



كتابة الارقام بالحروف - جبران جابر - 15-07-24

كيف يتم كتابة الارقام بالحروف في الفيجوال بيسك 6  مثلا 159 مائة وتسعة وخمسون Exclamation Exclamation Exclamation Exclamation Exclamation


RE: كتابة الارقام بالحروف - تركي الحلواني - 15-07-24

قم بعمل مديول جديد بأي اسم مثل (ٌRiyals)
ضع هذا الكود بداخله
PHP كود :
Public Function Digital(ByVal Amount As DoubleFLAGTYPE As String)
 On Error Resume Next
        Select 
Case FLAGTYPE
            
Case "Saudi"
                rs " ريـال "
                H "هلله "
                hS "هلل "
                POUNDS " ريالات "
                V Int(Math.Abs(Amount))
                VPS Val(Right(Format(Amount"000000000000.00"), 2))
                WORDINTEGER AmountWord(V)
                WORDPS AmountWord(VPS)
                If WORDINTEGER <> "" And (VPS <= 2Then Result WORDINTEGER rs " و " WORDPS H
                
If WORDINTEGER <> "" And (VPS >= And VPS <= 9Then Result WORDINTEGER rs " و " WORDPS hS
                
If WORDINTEGER <> "" And (VPS 9Then Result WORDINTEGER rs " و " WORDPS H
                
If WORDINTEGER "" And (VPS <= 2Then Result WORDPS H
                
If WORDINTEGER "" And (VPS >= And VPS <= 9Then Result WORDPS hS
                
If WORDINTEGER "" And VPS 9 Then Result WORDPS H
                
If WORDINTEGER "" And VPS 0 Then Result ""
                If WORDINTEGER <> "" And VPS 0 Then Result WORDINTEGER rs
                Digital 
Result
        End Select
End 
Function
Public Function 
AmountWord(ByVal Amount As Double)
  On Error Resume Next
  
        n 
Int(Amount)
        c Format(n"000000000000")
        C1 Val(Mid(c121))
        Select Case C1
            
Case Is 1str1 "واحد"
            Case Is 2str1 "اثنان"
            Case Is 3str1 "ثلاثة"
            Case Is 4str1 "اربعة"
            Case Is 5str1 "خمسة"
            Case Is 6str1 "ستة"
            Case Is 7str1 "سبعة"
            Case Is 8str1 "ثمانية"
            Case Is 9str1 "تسعة"
        End Select

        C2 
Val(Mid(c111))
        Select Case C2
            
Case Is 1str2 "عشر"
            Case Is 2str2 "عشرون"
            Case Is 3str2 "ثلاثون"
            Case Is 4str2 "اربعون"
            Case Is 5str2 "خمسون"
            Case Is 6str2 "ستون"
            Case Is 7str2 "سبعون"
            Case Is 8str2 "ثمانون"
            Case Is 9str2 "تسعون"
        End Select

        
If str1 <> "" And C2 1 Then str2 str1 " و" str2
        
If str2 "" Then str2 str1
        
If C1 And C2 1 Then str2 str2 "ة"
        If C1 And C2 1 Then str2 "احدى عشر "
        If C1 And C2 1 Then str2 "اثنى عشر "
        If C1 And C2 1 Then str2 str1 " " str2
        C3 
Val(Mid(c101))
        Select Case C3
            
Case Is 1str3 "مائة"
            Case Is 2str3 " مئتان "
            Case Is 2str3 Left(AmountWord(C3), Len(AmountWord(C3)) - 1) + "مائة"
        End Select
        
If str3 <> "" And str2 <> "" Then str3 str3 " و" str2
        
If str3 "" Then str3 str2

        C4 
Val(Mid(c73))
        Select Case C4
            
Case Is 1str4 " ألف"
            Case Is 2str4 " الفان"
            Case 3 To 10str4 AmountWord(C4) + " آلاف"
            Case Is 10str4 AmountWord(C4) + " ألف"
        End Select
        
If str4 <> "" And str3 <> "" Then str4 str4 " و" str3
        
If str4 "" Then str4 str3
        C5 
Val(Mid(c43))
        Select Case C5
            
Case Is 1str5 " مليون "
            Case Is 2str5 " مليونان "
            Case 3 To 10str5 AmountWord(C5) + " ملايين "
            Case Is 10str5 AmountWord(C5) + " مليون "
        End Select
        
If str5 <> "" And str4 <> "" Then str5 str5 " و" str4
        
If str5 "" Then str5 str4

        C6 
Val(Mid(c13))

        Select Case C6
            
Case Is 1str6 " مليار "
            Case Is 2str6 " ملياران "
            Case Is 2str6 AmountWord(C6) + " مليار "
        End Select
        
If str6 <> "" And str5 <> "" Then str6 str6 " و" str5
        
If str6 "" Then str6 str5
        AmountWord 
str6
End 
Function 
ومن ثم يكون استدعائها بهذا الشكل

PHP كود :
dim Amount as string "(فقط " Digital(TextAudit"Saudi") & "سعودي لاغير)." 



RE: كتابة الارقام بالحروف - جبران جابر - 19-08-24

(15-07-24, 03:58 PM)جبران جابر كتب : كيف يتم كتابة الارقام بالحروف في الفيجوال بيسك 6  مثلا 159 مائة وتسعة وخمسون Exclamation Exclamation Exclamation Exclamation Exclamation

شكرا بش مهندس ......بس ياريت اعرف هل هناك دالة معينة تفيدني في هذا الموضوع ام لابد من كتابة كود طويل