Source language: Translate to:

CONVERTIR NUMEROS EN LETRAS

Discusión sobre NeoBook en español

Moderators: Neosoft Support, beno

CONVERTIR NUMEROS EN LETRAS

Postby franco21 » Wed Feb 15, 2017 9:15 am

Alguien puede ayudarme para ayudar a una amiga docente a convertir numeros en letras....
por ejemplo ingresar en una variable un numero cualquiera y que se transforme en el valor expresado en letras...

456 > transformado a CUATROCIENTOS CINCUENTA y SEIS

Desde ya muchas gracias
franco21
 
Posts: 122
Joined: Tue Jan 14, 2014 3:46 pm

Re: CONVERTIR NUMEROS EN LETRAS

Postby virger » Wed Feb 15, 2017 3:49 pm

Quiza esto te ayude.
Code: Select all
NBW Publication Source File
(C)2016 NeoSoft Corp.
Title=PASAR de 'NUMEROS' a 'LETRAS'
Language=US
NeoBookVer=5,80
ScreenColors=16777216
ScreenWidth=640
ScreenHeight=240
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=31
BiDiMode=0
UseUpdateTimer=Yes
ReturnTime=60
ShapeTransColor=536870912
SplashProps=3
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
ReqExLevel=1
CustomFontName=Arial
CustomFontSize=9
CustomFontStyle=0
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required
L_PWORDMSG=Before continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wish to create a program folder?
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_SENDEMAIL=Sending Mail...
L_MAILSERVER=Please enter the name of your outgoing email server:
L_COPY=Copy to Clipboard
L_SELECTALL=Select All
L_DONWLOADFILE=Downloading: %s
L_PLEASEWAIT=Please wait...
TrayMenuBegin
MenuName=TrayOpen
MenuText=Open
MenuState=3
MenuKey=0
MenuAction=SetVar "[WindowState]" "Normal"
MenuName=TrayExit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=Exit "" ""
MenuEnd
MasterPage
NewPage=New Page
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
ObjectType=3
Name=BtConvertir
X=254
Y=28
W=133
H=35
Anchor=0
Text=Convertir
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=.uno,dos,tres,cuatro,cinco,seis,site,ocho,nueve,diez,once,doce,trece,catorce,quince,diez¶.setvar  "[ElNumero]" "1234"¶Call "Numero2Letras" "[ElNumero]" "[LasLetras]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
ObjectType=9
Name=TextEntry1
X=268
Y=0
W=104
H=26
Anchor=0
Text=12345678.90
VarName=[ElNumero]
Align=1
EditMask=00000000.00
EditLen=11
LineColor=0
LineWidth=1
LineStyle=0
FillColor=13684984
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=8
Name=InfFunction
X=132
Y=99
W=376
H=141
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0\b\ul\i FUNCTION de TIPO 'JAVASCRIPT'\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \{NeoBook Function\}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Version=5,80\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Language=JScript\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%vnum]|Variable|Numero A Convertir\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%let]|Variable|Numero En Letras\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \{End\}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 /*************************************************************/\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 // NumeroALetras\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 // The MIT License (MIT)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 // Copyright (c) 2015 Luis Alfredo Chee\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 /*************************************************************/\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 var num = nbGetVar("[%vnum]");\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function Unidades(num)\{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     switch(num)   \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 1: return "UN";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 2: return "DOS";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 3: return "TRES";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 4: return "CUATRO";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 5: return "CINCO";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 6: return "SEIS";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 7: return "SIETE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 8: return "OCHO";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 9: return "NUEVE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return "";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//Unidades()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function Decenas(num)\{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     decena = Math.floor(num/10);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0      unidad = num - ( decena*10 );\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     switch(decena)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 1:\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             switch(unidad)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 0: return "DIEZ";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 1: return "ONCE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 2: return "DOCE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 3: return "TRECE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 4: return "CATORCE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 5: return "QUINCE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 default: return "DIECI" + Unidades(unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             \}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 2:\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             switch(unidad)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 case 0: return "VEINTE";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 default: return "VEINTI" + Unidades(unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             \}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 3: return DecenasY("TREINTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 4: return DecenasY("CUARENTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 5: return DecenasY("CINCUENTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 6: return DecenasY("SESENTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 7: return DecenasY("SETENTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 8: return DecenasY("OCHENTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 9: return DecenasY("NOVENTA", unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 0: return Unidades(unidad);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//Unidades()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function DecenasY(strSin, numUnidades) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if (numUnidades > 0)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return strSin + " Y " + Unidades(numUnidades)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return strSin;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//DecenasY()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function Centenas(num) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     centenas = Math.floor(num / 100);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     decenas = num - (centenas * 100);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     switch(centenas)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 1:\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             if (decenas > 0)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 return "CIENTO " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             return "CIEN";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 2: return "DOSCIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 3: return "TRESCIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 4: return "CUATROCIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 5: return "QUINIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 6: return "SEISCIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 7: return "SETECIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 8: return "OCHOCIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         case 9: return "NOVECIENTOS " + Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \}\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return Decenas(decenas);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//Centenas()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function Seccion(num, divisor, strSingular, strPlural) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     cientos = Math.floor(num / divisor)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     resto = num - (cientos * divisor)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     letras = "";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if (cientos > 0)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         if (cientos > 1)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             letras = Centenas(cientos) + " " + strPlural;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         else\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             letras = strSingular;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if (resto > 0)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         letras += "";\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return letras;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//Seccion()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function Miles(num) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     divisor = 1000;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     cientos = Math.floor(num / divisor)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     resto = num - (cientos * divisor)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     strMiles = Seccion(num, divisor, "UN MIL", "MIL");\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     strCentenas = Centenas(resto);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if(strMiles == "")\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         return strCentenas;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return strMiles + " " + strCentenas;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//Miles()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function Millones(num) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     divisor = 1000000;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     cientos = Math.floor(num / divisor)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     resto = num - (cientos * divisor)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     strMillones = Seccion(num, divisor, "UN MILLON DE", "MILLONES \plain\f0\fs20\cf0 DE");\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     strMiles = Miles(resto);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if(strMillones == "")\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         return strMiles;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     return strMillones + " " + strMiles;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//Millones()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 function NumeroALetras(num) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     var data = \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         numero: num,\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         enteros: Math.floor(num),\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         centavos: (((Math.round(num * 100)) - (Math.floor(num) * 100))),\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         letrasCentavos: "",\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         letrasMonedaPlural: 'COLONES', // 'C\'f3rdobas',"PESOS", \plain\f0\fs20\cf0 'D\'f3lares', 'Bol\'edvares', 'etcs'\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         letrasMonedaSingular: 'COLON', // 'C\'f3rdoba', "PESO", 'D\'f3lar', \plain\f0\fs20\cf0 'Bolivar', 'etc'\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         // letrasMonedaCentavoPlural: "CENTAVOS",        \plain\f0\fs20\cf0 letrasMonedaCentavoSingular: "CENTAVO"\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \tab  \tab letrasMonedaCentavoPlural: "CENTIMOS",\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         letrasMonedaCentavoSingular: "CENTIMO"\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \};\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if (data.centavos > 0) \{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         data.letrasCentavos = "CON " + (function ()\{\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             if (data.centavos == 1)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 return Millones(data.centavos) + " " + \plain\f0\fs20\cf0 data.letrasMonedaCentavoSingular;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             else\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0                 return Millones(data.centavos) + " " + \plain\f0\fs20\cf0 data.letrasMonedaCentavoPlural;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0             \})();\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     \};\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if(data.enteros == 0)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         return "CERO " + data.letrasMonedaPlural + " " + \plain\f0\fs20\cf0 data.letrasCentavos;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     if (data.enteros == 1)\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         return Millones(data.enteros) + " " + data.letrasMonedaSingular \plain\f0\fs20\cf0 + " " + data.letrasCentavos;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0     else\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0         return Millones(data.enteros) + " " + data.letrasMonedaPlural + " \plain\f0\fs20\cf0 " + data.letrasCentavos;\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}//NumeroALetras()\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 var ret = NumeroALetras(num);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 nbSetVar("[%let]", ret);\par\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 }}}
HMargin=0
VMargin=2
LineColor=0
LineWidth=1
LineStyle=0
FillColor=15198183
FillPattern=0
TabOrder=4
ObjectType=8
Name=InLetras
X=0
Y=66
W=640
H=32
Anchor=0
Font=Arial
FontSize=8
FontStyle=3
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs16\cf0\b\i [LasLetras]}}}
HMargin=2
VMargin=2
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12646600
FillPattern=0
TabOrder=5


Lo use en 2016 para tarea de uno de mis nietos.
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: CONVERTIR NUMEROS EN LETRAS

Postby quili » Tue May 02, 2017 10:58 am

Hola, existe un plugin que lo hace de una forma sencilla, se llama "dec_plus".
La función seria esta: "dec_PasarDeNumerosALetras"
quili
 
Posts: 7
Joined: Thu Oct 02, 2014 11:31 am


Return to NeoBook en Español

Who is online

Users browsing this forum: No registered users and 1 guest