
Convertir cantidades a cadena
Clipper/FiveWin
Publicado el 23 de Septiembre del 2003 por Bayron Landaverry
12.725 visualizaciones desde el 23 de Septiembre del 2003
Se incluyen dos códigos que devuelven, respectivante, el texto en castellano y en inglés de la cantidad introducida por el usuario.
Comentarios sobre la versión: Versión 1 (4)
num=1
Do While Num#7
If &Condicion
* Initialize memory variables
STORE " ONE TWO THREEFOUR FIVE SIX SEVENEIGHTNINE " TO ones
"SEVENTEENEIGHTEEN NINETEEN " TO teen
STORE "TWENTY THIRTY FORTY FIFTY SIXTY SEVENTYEIGHTY NINETY" TO tens
* Store whole dollar amount to a string
* check hundreds of thousands
* check tens of thousands and thousands
* check hundreds
* check tens and ones
* Convert decimal places to a string containing cents amount
IF tamt > 0
* broken up so that it will fit on the check
IF length > 75
counter = 74
* divide the word into two parts and display
@ 11,4 SAY word1
@ 12,10 SAY word2
* else word is less than or equal to 75 characters
@ 11,4 SAY word1