Your SlideShare is downloading. ×
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Codigo para convertir numeros a letras
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Codigo para convertir numeros a letras

1,005

Published on

Publicado por Jorge Cruz y …

Publicado por Jorge Cruz y
Creado por Edwin Raymundo

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,005
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Function CONVIERTENUMLETRA(NUMERO)Dim TEXTODim MILLONESDim MILESDim CIENTOSDim DECIMALESDim CADENADim CADMILLONESDim CADMILESDim CADCIENTOSTEXTO = NUMEROIf TEXTO = "0" ThenCONVIERTENUMLETRA = Trim("CERO")ElseTEXTO = FormatNumber(TEXTO, 2)TEXTO = Right(Space(14) & TEXTO, 14)MILLONES = Mid(TEXTO, 1, 3)MILES = Mid(TEXTO, 5, 3)CIENTOS = Mid(TEXTO, 9, 3) no voy a utilizar DECIMALES = Mid(TEXTO, 13, 2)
  • 2. CADMILLONES = CONVIERTECIFRA(MILLONES, 1)CADMILES = CONVIERTECIFRA(MILES, 1)CADCIENTOS = CONVIERTECIFRA(CIENTOS, 0)If Trim(CADMILLONES) > "" ThenIf Trim(CADMILLONES) = "UN" ThenCADENA = CADMILLONES & " MILLON"ElseCADENA = CADMILLONES &" MILLONES"End IfEnd IfIf Trim(CADMILES) > "" ThenCADENA = CADENA & " " & CADMILES & " MIL"End IfIf Trim(CADMILES & CADCIENTOS) = "UN" ThenCADENA = CADENA & "UNO PESOS"ElseIf MILES & CIENTOS = "000000" ThenCADENA = CADENA & " " &Trim(CADCIENTOS)ElseCADENA = CADENA & " " &Trim(CADCIENTOS)
  • 3. End IfEnd IfCONVIERTENUMLETRA = Trim(CADENA)End If * FINAL DE LA DECISION SINO ERA 0End FunctionFunction CONVIERTECIFRA(TEXTO, SW)Dim CENTENADim DECENADim UNIDADDim TXTCENTENADim TXTDECENADim TXTUNIDADCENTENA = Mid(TEXTO, 1, 1)DECENA = Mid(TEXTO, 2, 1)UNIDAD = Mid(TEXTO, 3, 1)Select Case CENTENACase "1"TXTCENTENA = "CIEN"If DECENA & UNIDAD <> "00" Then
  • 4. TXTCENTENA = "CIENTO"End IfCase "2"TXTCENTENA = "DOSCIENTOS"Case "3"TXTCENTENA = "TRESCIENTOS"Case "4"TXTCENTENA = "CUATROCIENTOS"Case "5"TXTCENTENA = "QUINIENTOS"Case "6"TXTCENTENA = "SEISCIENTOS"Case "7"TXTCENTENA = "SETECIENTOS"Case "8"TXTCENTENA = "OCHOCIENTOS"Case "9"TXTCENTENA = "NOVECIENTOS"End SelectSelect Case DECENACase "1"TXTDECENA = "DIEZ"Select Case UNIDADCase "1"
  • 5. TXTDECENA = "ONCE"Case "2"TXTDECENA = "DOCE"Case "3"TXTDECENA = "TRECE"Case "4"TXTDECENA = "CATORCE"Case "5"TXTDECENA = "QUINCE"Case "6"TXTDECENA = "DIECISEIS"Case "7"TXTDECENA = "DIECISIETE"Case "8"TXTDECENA = "DIECIOCHO"Case "9"TXTDECENA = "DIECINUEVE"End SelectCase "2"TXTDECENA = "VEINTE"If UNIDAD <> "0" ThenTXTDECENA = "VEINTI"End IfCase "3"TXTDECENA = "TREINTA"
  • 6. If UNIDAD <> "0" ThenTXTDECENA = "TREINTA Y "End IfCase "4"TXTDECENA = "CUARENTA"If UNIDAD <> "0" ThenTXTDECENA = "CUARENTA Y "End IfCase "5"TXTDECENA = "CINCUENTA"If UNIDAD <> "0" ThenTXTDECENA = "CINCUENTA Y "End IfCase "6"TXTDECENA = "SESENTA"If UNIDAD <> "0" ThenTXTDECENA = "SESENTA Y "End IfCase "7"TXTDECENA = "SETENTA"If UNIDAD <> "0" ThenTXTDECENA = "SETENTA Y "End IfCase "8"
  • 7. TXTDECENA = "OCHENTA"If UNIDAD <> "0" ThenTXTDECENA = "OCHENTA Y "End IfCase "9"TXTDECENA = "NOVENTA"If UNIDAD <> "0" ThenTXTDECENA = "NOVENTA Y "End IfEnd SelectIf DECENA <> "1" ThenSelect Case UNIDADCase "1"If SW ThenTXTUNIDAD = "UN"ElseTXTUNIDAD = "UNO"End IfCase "2"TXTUNIDAD = "DOS"Case "3"TXTUNIDAD = "TRES"Case "4"TXTUNIDAD = "CUATRO"
  • 8. Case "5"TXTUNIDAD = "CINCO"Case "6"TXTUNIDAD = "SEIS"Case "7"TXTUNIDAD = "SIETE"Case "8"TXTUNIDAD = "OCHO"Case "9"TXTUNIDAD = "NUEVE"End SelectEnd IfCONVIERTECIFRA = TXTCENTENA & " " & TXTDECENA & TXTUNIDADEnd Function

×