Sub NumberToString() 'Programed By ProGa (R) 2001 'E-mail: ProGa@ukrpost.net Dim strNumber As String Dim Digitals() As Integer Dim BigDig As Integer Dim Dig1 As Integer, Dig2 As Integer, Dig3 As Integer Dim AvDig As Integer Dim DigCount As Integer Dim BigDigCount As Integer Dim BigDigNames(4, 2) As String Dim DigNames(9, 2) As String Dim From11till19(9) As String Dim Result As String Dim i As Integer Dim Pointer As Integer Dim Temp As Integer On Error GoTo EndSub BigDigNames(0, 0) = "гривен" BigDigNames(0, 1) = "гривна" BigDigNames(0, 2) = "гривны" BigDigNames(1, 0) = "тысяч" BigDigNames(1, 1) = "тысяча" BigDigNames(1, 2) = "тысячи" BigDigNames(2, 0) = "миллионов" BigDigNames(2, 1) = "миллион" BigDigNames(2, 2) = "миллиона" BigDigNames(3, 0) = "миллиардов" BigDigNames(3, 1) = "миллиард" BigDigNames(3, 2) = "миллиарда" BigDigNames(4, 0) = "триллиардов" BigDigNames(4, 1) = "триллиард" BigDigNames(4, 2) = "триллиарда" DigNames(1, 0) = "один" DigNames(2, 0) = "два" DigNames(3, 0) = "три" DigNames(4, 0) = "четыре" DigNames(5, 0) = "пять" DigNames(6, 0) = "шесть" DigNames(7, 0) = "семь" DigNames(8, 0) = "восемь" DigNames(9, 0) = "девять" DigNames(1, 1) = "десять" DigNames(2, 1) = "двадцать" DigNames(3, 1) = "тридцать" DigNames(4, 1) = "сорок" DigNames(5, 1) = "пятьдесят" DigNames(6, 1) = "шестьдесят" DigNames(7, 1) = "семьдесят" DigNames(8, 1) = "восемьдесят" DigNames(9, 1) = "девяносто" DigNames(1, 2) = "сто" DigNames(2, 2) = "двести" DigNames(3, 2) = "триста" DigNames(4, 2) = "четыреста" DigNames(5, 2) = "пятьсот" DigNames(6, 2) = "шестьсот" DigNames(7, 2) = "семьсот" DigNames(8, 2) = "восемьсот" DigNames(9, 2) = "дявятьсот" From11till19(1) = "одиннадцать" From11till19(2) = "двенадцать" From11till19(3) = "тринадцать" From11till19(4) = "четырнадцать" From11till19(5) = "пятнадцать" From11till19(6) = "шестнадцать" From11till19(7) = "семнадцать" From11till19(8) = "восемнадцать" From11till19(9) = "девятнадцать" strNumber = Trim(Selection.Text) DigCount = Len(strNumber) Do Until DigCount Mod 3 = 0 strNumber = "0" & strNumber DigCount = DigCount + 1 Loop BigDigCount = Fix(DigCount / 3) If BigDigCount > 5 Then Exit Sub ReDim Digitals(DigCount) As Integer For i = 1 To DigCount Digitals(i) = CInt(Mid(strNumber, DigCount - i + 1, 1)) Next i Result = "" For i = 0 To BigDigCount - 1 Dig1 = Digitals(i * 3 + 1) Dig2 = Digitals(i * 3 + 2) Dig3 = Digitals(i * 3 + 3) AvDig = Dig2 * 10 + Dig1 BigDig = Dig3 * 100 + AvDig If BigDig = 0 Then If i = 0 Then Result = " " & BigDigNames(0, 0) Else If AvDig < 20 Then Temp = AvDig Else Temp = Dig1 End If If Temp = 0 Then Pointer = 0 If Temp = 1 Then Pointer = 1 If Temp > 1 And Temp < 5 Then Pointer = 2 If Temp > 4 Then Pointer = 0 Result = " " & BigDigNames(i, Pointer) & Result End If If AvDig > 10 And AvDig < 20 Then Result = " " & From11till19(AvDig Mod 10) & Result Else If Dig1 <> 0 Then Result = " " & DigNames(Dig1, 0) & Result If Dig2 <> 0 Then Result = " " & DigNames(Dig2, 1) & Result End If If Dig3 <> 0 Then Result = " " & DigNames(Dig3, 2) & Result Next i Result = Trim(Result) Mid(Result, 1, 1) = StrConv(Mid(Result, 1, 1), vbUpperCase) Selection.Text = Selection.Text & " (" & Result & ")" EndSub: End Sub