Duda como pasar valor numerico a letras

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
Buenas tengo una duda de como hacer para pasar números a letras en lua, yo me puse ha desarrollar algo pero al final no es nada viable ya que era una gran secuencia de if y elseif por cada numero y al final eso no es nada factible les dejo lo que tengo a ver si alguien a logrado algo mejor que esto.
Numeros = tonumber(Input.GetText("Inpletras"));
----------------------Billetes de 1 al 9---------------------------	
if Numeros == 1 or Numeros <= 1.99 then
	Paragraph.SetText("Paragraph1", "UN LEMPIRA EXACTOS");
elseif Numeros == 2  or Numeros <= 2.99  then
	Paragraph.SetText("Paragraph1", "DOS LEMPIRAS EXACTOS");
elseif Numeros == 3 or Numeros <= 3.99  then
	Paragraph.SetText("Paragraph1", "TRES LEMPIRAS EXACTOS");
elseif Numeros == 4 or Numeros <= 4.99  then
	Paragraph.SetText("Paragraph1", "CUATRO EXACTOS");
elseif Numeros == 5 or Numeros <= 5.99  then
	Paragraph.SetText("Paragraph1", "CINCO EXACTOS");
elseif Numeros == 6 or Numeros <= 6.99  then
	Paragraph.SetText("Paragraph1", "SEIS EXACTOS");
elseif Numeros == 7 or Numeros <= 7.99  then
	Paragraph.SetText("Paragraph1", "SIETE EXACTOS");
elseif Numeros == 8 or Numeros <= 8.99  then
	Paragraph.SetText("Paragraph1", "OCHO EXACTOS");
elseif Numeros == 9 or Numeros <= 9.99  then
	Paragraph.SetText("Paragraph1", "NUEVE EXACTOS");
elseif Numeros == 10 or Numeros <= 10.99  then
	Paragraph.SetText("Paragraph1", "DIEZ EXACTOS");
	

		
end
welcome Agotaras123
if Numeros == 1 or Numeros <= 1.99 then
This precondition in the opinion is incorrect
Because it will restrict the condition to only 1 or 1.99

The solution to release her corrective unleash her or to be redeemed and

I think her correction must be:

Código: Seleccionar todo

if Numeros == 1 and Numeros <= 1.99 then

All of the following are conditional sentences in the same style : Change or to and


:yeah-1417757020: I think this can be shortened too long to code less by repetition " for or repeat or while " any one of them I can help with a shortcut if what I told you is true .
abood1987 escribió:
13 Ago 2019 21:51
welcome Agotaras123
if Numeros == 1 or Numeros <= 1.99 then
This precondition in the opinion is incorrect
Because it will restrict the condition to only 1 or 1.99

The solution to release her corrective unleash her or to be redeemed and

I think her correction must be:

Código: Seleccionar todo

if Numeros == 1 and Numeros <= 1.99 then

All of the following are conditional sentences in the same style : Change or to and


:yeah-1417757020: I think this can be shortened too long to code less by repetition " for or repeat or while " any one of them I can help with a shortcut if what I told you is true .

muchas gracias por tu sugerencia pero no estoy buscando usar este mismo código lo que quiero es ver de que manera simplificarlo e visto que en c# hay varias funciones que hacen eso posible pero no se como hacerlo para lua.
Numeros = tonumber(Input.GetText("Inpletras"));
----------------------Billetes de 1 al 9000    ---------------------------	
for i=1,10000 do
    if Numeros == i or Numeros < i+1 then
        Paragraph.SetText("Paragraph1", "UN LEMPIRA EXACTOS   =  "..Numeros);
       break 
    end
end
This method of work of the iterative function, the content of the condition depends on what you do and what you exactly want this to be very easy and we can use arrays to output suitable for each condition separately results
I mean that the output of the pragraph can be controlled as we would like through arrays for example
Do you want to create a code that writes what the user enters as text ?
tu ejemplo lo pensé también pero no logre hacer nada con eso ya que ahí lo que aras es que el for cuente del 1 al 1000 y te devolverá los números contados como resultado, creo que no entiendes aun lo que yo busco.

ejemplo si yo tengo como resultado esta cantidad 120.00 quiero que me de aparte de ese valor en números me lo muestre en texto de esta manera: 120.00 son Ciento Veinte exactos.

como en las facturas de compra del supermercado que muestra el valor a pagar en números y en letras o en los cheques también que pones el monto del cheque en una casilla y en otra te sale el mismo valor pero en letras.

eso es lo que busco hacer pero no lo he logrado.
Yes, I understand what you want now
I will try to set a simplified example
I will now start trying and when I finish I will leave you a reply here .
Extended Number ?
dripro escribió:
13 Ago 2019 23:45
Extended Number ?
Convert from a number to readable text expressing the number
abood1987 escribió: Sí, entiendo lo que quieres ahora
. Intentaré establecer un ejemplo simplificado
. Comenzaré a intentarlo y cuando termine te dejaré una respuesta aquí.
muchas gracias

dripro escribió:
13 Ago 2019 23:45
Extended Number ?
has mirado las facturas de los supermercados que te dice

Total a Pagar: 1500.00
Son: Mil Quinientos exactos.

eso es lo que busco hacer.
dripro escribió:
14 Ago 2019 00:05
https://www.invertexto.com/numeros-por-extenso
+ ou - assim ? né
correcto algo como eso es lo que ocupo pero en lua.
This pattern will rely very simple model :
Numeros = tonumber(Input.GetText("Inpletras"));
verb = {"واحد","إثنين","ثلاثة","أربعة","خمسة","ستة","سبع","ثمانية","تسعة","عشرة"};
Fracture ={"عشرة قروش","عشرون قرشا","ثلاثون قرشا","أربعون قرشا","خمسون قرشا","ستون قرشا","سبعون قرشا","ثمانون قرشا","تسعون قرشا"};
Fracture2 ={"إحدى عشر قرشا","إثنى عشر قرشا","ثلاثة عش قرشاا","أربعة عشر قرشا","خمسة عشر قرشا","ستة عشر قرشا","سبعة عشر قرشا","ثمانية عشر قرشا","تسعة عشر قرشا"};	

----------------------Billetes de 1 al 10 ---------------------------
for i=1,9 do
    if Numeros == i or Numeros < (i+1)- ".01" then
      if String.Find(Input.GetText("Inpletras"), ".", 1, false)~=-1 then
	      if String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1)~="" and String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1) > "00" and String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1) < "11" then
	          Paragraph.SetText("Paragraph1", verb[i] .." جنيها ".." و "..Fracture[tonumber(String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1))]);
            elseif String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1)~="" and String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1) > "10" and String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1) < "21" then
              Paragraph.SetText("Paragraph1", verb[i] .." جنيها ".." و "..Fracture2[tonumber(String.Mid(Input.GetText("Inpletras"), String.Find(Input.GetText("Inpletras"), ".", 1, false)+1, -1))-10]);
	      end
	     else
	       Paragraph.SetText("Paragraph1", verb[i] .." جنيها فقط لا غير"); 
	  end
       break 
    end
end
There is an Arabic language that we can replace with other languages
This is only an explanation of the action steps We can complete it like this .

:yeah-1417757020: I can further decode the code to understand the steps and explain them in detail
I will put a full-fledged example apz later when I finish
A basic example friend "of a dose" you can increment
HIDE: ON
Hidebb Message Hidden Description
thanks my friend .... good midaugust :lol: :lol:
muchas gracias a los dos por su ayuda voy a revisar y ver como adaptarlo a lo que ocupo cuando lo tenga lo publico.

lo que me fijo que cuando los números tiene decimales no realiza ningún resultado.
Agotaras123 escribió: muchas gracias a los dos por su ayuda voy a revisar y ver como adaptarlo a lo que ocupo cuando lo tenga lo publico.

lo que me fijo que cuando los números tiene decimales no realiza ningún resultado.

example: DriPro
simple decimals reworked





MEGA.NZ
HIDE: ON
Hidebb Message Hidden Description
muchas gracias usamakey me fije que usaste Math.Floor para tomar el entero, esta bien la idea pero en esencia no se debe de eliminar los decimales ya que esos se agregan al fina siempre ejemplo:

125.50 Resultado = Ciento veinticinco con 50/100 centavos
welcome again Agotaras123
Sorry for the delay due to a little busy :friends:
In this example you can only up to 100
If you want to increase, read the text file called Numbers in the Docs folder and put more in the same way
The method you have adopted is the easiest way possible
this is my easy code :
HIDE: ON
Hidebb Message Hidden Description


HIDE: ON
Hidebb Message Hidden Description



:yes: :yes: :yes: