Lotus Approach - NUMEROS A LETRAS

 
Vista:

NUMEROS A LETRAS

Publicado por CARLOS GONZALES (1 intervención) el 16/10/2006 16:10:38
ESTOY EN LA CIUDAD DE IQUITOS - PERU , UTILIZO EL LOTUS SMARTSUITE 97 ESPAÑOL, ESTOY CON UN PROBLEMA PORQUE TENGO UNA SMARTMASTER SOBRE EMITIR UNA CHEQUERA Y NECESITO CONVERTIR LOS NUMEROS QUE SE INGRESÒ EN LETRAS PARA PODER MANDAR A IMPRIMIR, POR FAVOR SI ME PUEDEN AYUDAR LES ESTARÌA AGRADECIDO YA QUE NO PUEDO UTILIZAR LA APLICACIÒN.

ATT. CARLOS GONZALES
IQUITOS - PERU
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:NUMEROS A LETRAS

Publicado por Juan Pablo (2 intervenciones) el 18/10/2006 18:10:21
Carlos te adjunto el script como lo puedes hacer.
este script esta hecho para que te arroje resultados en ingles solo tienes que cambiarlo a español ej. donde te dice "ten" tu ponle "diez" y asi sucecibamente.

si está algo complicado el script mandame un mail y te mando un archivo con macros mas cencillo.

Saludos,

Juan Pablo Moreno
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
'How To Use It:
'=============
'Copy and paste the three following functions into the script editor:
'   - ConvertNumberToText
'   - ConvertTwoNumbers
'   - ConvertThreeNumbers
'Then, somewhere in your own code, call the ConvertNumberToText
'function by putting:
'    result$ = ConvertNumberToText(x)
'The script works for numbers ranging from 1 to 999,999,999.
Function ConvertNumberToText(getal)
        Dim e$(10)
        Dim t$(10)
        Dim h$(10)
        e$(1) = "one"
        e$(2) = "two"
        e$(3) = "three"
        e$(4) = "four"
        e$(5) = "five"
        e$(6) = "six"
        e$(7) = "seven"
        e$(8) = "eight"
        e$(9) = "nine"
        e$(10) = "ten"
        t$(1) = "eleven"
        t$(2) = "twelve"
        t$(3) = "thirteen"
        t$(4) = "fourteen"
        t$(5) = "fifteen"
        t$(6) = "sixteen"
        t$(7) = "seventeen"
        t$(8) = "eighteen"
        t$(9) = "nineteen"
        t$(10) = "twenty"
        h$(1)="ten"
        h$(2)="twenty"
        h$(3)="thirty"
        h$(4)="fourty"
        h$(5)="fifty"
        h$(6)="sixty"
        h$(7)="seventy"
        h$(8)="eighty"
        h$(9)="ninety"
        h$(10)="hundred"
        g$ = Format$(getal)  'Make a string of the number
        L = Len(g$)
        If L >=1 Then
                o1$ = e$(Val(Right$(g$,1)))
                If Len(g$) = 1 Then r$ = o1$:Goto finished
        End If
        If L >= 2 Then
                o2$ = ConvertTwoNumbers(g$,e$(),h$(),t$())
                If Len(g$) = 2 Then r$ = o2$:Goto finished
        End If
        If L >=3 Then
                o3$ = ConvertThreeNumbers(g$,e$(),h$(),t$())
                If Len(g$) = 3 Then r$ = o3$:Goto finished
        End If
        If L >= 4 Then
                v$ = Right$(g$,4)
                If Val(Left$(v$,1)) <> 1 Then
                        o4$ = e$(Val(Left$(v$,1))) + " thousand " + o3$
                Else
                        o4$ = " thousand " + o3$
                End If
                If Len(g$) = 4 Then r$ = o4$: Goto finished
        End If
        If L >= 5 Then
                v$ = Right$(g$,5)
                o5$ = ConvertTwoNumbers(Left$(v$,2),e$(),h$(),t$()) + " thousand " + o3$
                If Len(g$) = 5 Then r$ = o5$:Goto finished
        End If
        If L >=6 Then
                v$ = Right$(g$,6)
                o6$ = ConvertThreeNumbers(Left$(v$,3),e$(),h$(),t$()) + " thousand "  + " "+o3$
                If Len(g$) = 6 Then r$ = o6$:Goto finished
        End If
        If L >= 7       Then
                v$ = Right$(g$,7)
                o7$ = e$(Val(Left$(v$,1))) + " million " + ConvertThreeNumbers(Mid$(v$,2,3),e$(),h$(),t$()) + " thousand " + o3$
                If Len(g$) = 7 Then r$ = o7$: Goto finished
        End If
        If L >= 8       Then
                v$ = Right$(g$,8)
                o8$ = ConvertTwoNumbers(Left$(v$,2),e$(),h$(),t$()) + " million " + ConvertThreeNumbers(Mid$(v$,3,3),e$(),h$(),t$()) + " thousand " + o3$
                If Len(g$) = 8 Then r$ = o8$: Goto finished
        End If
        If L >= 9       Then
                v$ = Right$(g$,9)
                o9$ = ConvertThreeNumbers(Left$(v$,3),e$(),h$(),t$()) + " million " + ConvertThreeNumbers(Mid$(v$,4,3),e$(),h$(),t$()) + " thousand " + o3$
                If Len(g$) = 9 Then r$ = o9$: Goto finished
        End If finished:
        ConvertNumberToText = r$
End Function
Function ConvertThreeNumbers(what$,e$(),h$(),t$())
        v$ = Right$(what$,3)
        v2$ = ConvertTwoNumbers(Right$(what$,2),e$(),h$(),t$())
        If Left$(v$,1) = "0" Then ConvertThreeNumbers = ConvertTwoNumbers(v$,e$(),h$(),t$())    :Exit Function
        If Val(v$) = 0 Then ConvertThreeNumbers = "":Exit Function
        If Val(Left$(v$,1)) <> 1 Then
                If Val(v2$) <> 0 Then
                        ConvertThreeNumbers = e$(Val(Left$(v$,1))) + " hundred and " + v2$
                Else
                        ConvertThreeNumbers = e$(Val(Left$(v$,1))) + " hundred " + v2$
                End If
        Else
                If Val(v2$) <> 0 Then
                        ConvertThreeNumbers = " hundred and " + v2$
                Else
                        ConvertThreeNumbers = " hundred " + v2$
                End If
        End If
End Function
Function ConvertTwoNumbers(what$,e$(),h$(),t$())
        v$ = Right$(what$,2)
        If Val(v$) >=11 And Val(v$) <= 19 Then
                ConvertTwoNumbers = t$(Val(v$)-10)
        Else
                If Val(Right$(v$,1)) <> 0 Then
                        ConvertTwoNumbers = h$(Val(Left$(v$,1))) + "-" + e$(Val(Right$(v$,1)))
                Else
                        ConvertTwoNumbers = h$(Val(Left$(v$,1)))
                End If
        End If
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por BernardO (2 intervenciones) el 07/12/2008 15:43:28
juan Pablo, la script que publicaste respecto de Num a Letras arroja un error al final, me la podrias enviar nuevamente corregida.

Muchas gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por eduardo (2 intervenciones) el 06/01/2009 02:56:40
Que tal Juan pablo ya intente colocar el scrip que nos comentas pero me arroja un error no se si me puedas ayudar a resolver este detalle que ya tengo tiempo tratanto de solucionarlo...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por Miguel (5 intervenciones) el 20/09/2011 16:34:51
Maestro si fueras tan amable de pasarme la macro te estare muy agredecido... lo he intentado y no me sale con el scrip :(
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por J/L! (17 intervenciones) el 09/11/2006 17:45:41
Saludos cordiales

pense que se habría solucionado tu problema con la macros que te envié, si no es el caso comunicate nuevamente que con gusto te ayudaré
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por Ale Cruz (1 intervención) el 22/08/2007 22:40:01
Hola, seria posible que me enviaras a mi tambien las macros para cambiar de numeros a letras?
Gracias.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por Miguel (5 intervenciones) el 28/12/2011 14:46:04
Me podrias enviar la macro a mi tambien, te estare indefiniblemente en deuda contigo...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por César Herrera (1 intervención) el 17/04/2012 01:16:45
Hola, he intentado utilizar el script pero hay un problema en el código, ya que la parte de

End If finished:

Aparece en rojo y no me deja salvar el script. Te agradecería mucho si pudieras ayudarme con esto.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por Julio (2 intervenciones) el 12/09/2012 19:37:58
A mi tambien, no me deja salvar el script. Lo he revisado y no doy con la tecla.
Gracias por tu atencion. Saludos
Julio
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:NUMEROS A LETRAS

Publicado por joel alt (1 intervención) el 27/11/2012 19:41:15
Hola alguien podria enviarme las macros por favor ya que tambien me marca error el scrip gracias, saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar