Ingeniero Civil

Páginas: 3 (526 palabras) Publicado: 11 de julio de 2011
Public Function NumeroATextoTOPO(ByVal d As Double) As String

If d - Int(d) Then

Lentero = Num2Text(Int(d))

Ldec = Num2Text(Mid(d - Int(d), 3, 3))

NumeroATextoTOPO = Num2Text(Int(d)) & "PUNTO " & Num2Text(Mid(d - Int(d), 3, 3))

Else

NumeroATextoTOPO = Num2Text(Int(d))

End If

End Function

Public Function Letras(Valor As Double) As String

Dim Largo As IntegerDim Decimales As Double, strDecimal As String

Largo = Len(CStr(Format(CDbl(Valor), "#,###.00")))

Decimales = Mid(CStr(Format(CDbl(Valor), "#,###.00")), Largo - 2)

Select CaseDecimales

Case 0: strDecimal = "00"

Case 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9: strDecimal = (Mid(CStr(Decimales), 3, 2)) * 10

Case Is < 100: strDecimal =Mid(CStr(Decimales), 3, 2)

End Select

Valor = Valor - Decimales

Letras = Num2Text(Valor) & " PESOS " & strDecimal & "/100 M.N."

End Function

Public Function NumeroATexto(ByVal d As Double) AsString

If d - Int(d) Then

Lentero = Num2Text(Int(d))

Ldec = Num2Text(Mid(d - Int(d), 3, 2))

NumeroATexto = Num2Text(Int(d)) & " PESOS CON " & Num2Text(Mid(d - Int(d), 3, 2)) & " CENTAVOS"Else

NumeroATexto = Num2Text(Int(d)) & " PESOS"

End If

End Function

Public Function Num2Text(ByVal value As Double, Optional bandera as Integer = 0) As String
   Select Case value
      Case 0 : Num2Text = "CERO"
       Case 1 : If bandera = 0 then Num2Text = "UNO" else Num2Text = "UN"
       Case 2 : Num2Text = "DOS"
       Case 3 : Num2Text = "TRES"
       Case 4 : Num2Text= "CUATRO"
       Case 5 : Num2Text = "CINCO"
       Case 6 : Num2Text = "SEIS"
       Case 7 : Num2Text = "SIETE"
       Case 8 : Num2Text = "OCHO"
       Case 9 : Num2Text = "NUEVE"
      Case 10 : Num2Text = "DIEZ"
       Case 11 : Num2Text = "ONCE"
       Case 12 : Num2Text = "DOCE"
       Case 13 : Num2Text = "TRECE"
       Case 14 : Num2Text = "CATORCE"
       Case 15 :...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Ingeniero Civil
  • Ingeniero Civil
  • Ingeniero Civil
  • ingeniero civil
  • Ingeniero Civil
  • ingeniero civil
  • ingeniero civil
  • ingeniero civil

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS