
Convertir cantidades a cadena
Clipper/FiveWin
Publicado el 23 de Septiembre del 2003 por Bayron Landaverry
12.970 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=1Do While Num#7If &Condicion* Initialize memory variablesSTORE " ONE TWO THREEFOUR FIVE SIX SEVENEIGHTNINE " TO ones"SEVENTEENEIGHTEEN NINETEEN " TO teenSTORE "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 amountIF tamt > 0* broken up so that it will fit on the checkIF length > 75counter = 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