'** **'
'** CONVERTIR DE NUMEROS A LETRAS **'
'** AUTOR: OSCAR JAVIER LEON AVENDA�O **'
'** licencia: USO LIBRE **'
'** http:www.oscarjleon.com **'
'** FECHA DE CREACION: NOV.1991 **'
'** **'
'**********************************************************************
CLetras = strTMP
End Function
intNumeroEntero = Int(numero)
Centenas = Int(numero / 100)
If Genero = "M" Then
strCentenas(1) = "ciento": strCentenas(2) = "doscientos":
strCentenas(3) = "trecientos": strCentenas(4) = "cuatrocientos":
strCentenas(5) = "quinientos": strCentenas(6) = "seiscientos":
strCentenas(7) = "setecientos": strCentenas(8) = "ochocientos":
strCentenas(9) = "novecientos"
Else
strCentenas(1) = "ciento": strCentenas(2) = "doscientas":
strCentenas(3) = "trecientas": strCentenas(4) = "cuatrocientas":
strCentenas(5) = "quinientas": strCentenas(6) = "seiscientas":
strCentenas(7) = "setecientas": strCentenas(8) = "ochocientas":
strCentenas(9) = "novecientas"
End If
Select Case numero
Case 0 To 99
strTMP = CLetrasS2(intNumeroEntero, Genero)
Case 100
strTMP = "cien"
Case 200, 300, 400, 500, 600, 700, 800, 900
strTMP = strCentenas(Centenas)
Case Else
strTMP = strCentenas(Centenas) & " " & CLetrasS2(Int(numero -
(Centenas * 100)), Genero)
End Select
CLetrasS1 = strTMP
End Function
'Funcion secundaria que saca un tres cifras del numero
Private Function CLetrasS3(numero As Double, Tercio As Integer) As
Integer
Dim CadaCifra As Integer
Dim OrdenInverso As Integer
Dim intNumeroTmp As Integer
Dim NombreCifra(1 To 12) As String
OrdenInverso = Len(CStr(numero))
'Borra la matriz
For CadaCifra = 1 To 12: NombreCifra(CadaCifra) = "0": Next CadaCifra