Number to text
- Started
- Last post
- 14 Responses
- ********
I'm looking for a javascript that turns a given number to its text equivalent eg. 100 > One hundred.
- rson0
like this http://www.houseoffusion.com/gro…
- rson0
NumberObject.valueOf() ????
- ********0
I forgot to mention, it has to return the value in spanish
- drgs0
NumberObject.valueOf.toSpanish()
- ********0
ok, I found a script that i've tweaked a little bit, here's a sample:
http://www.colectivo2.com/nt/Tes…
It works just fine but I'm having trouble implementing it into a PDF document field. I've replace the last few lines of the script in my pdf form with the following:
...
/* Regresa el número en cadena entre paréntesis y con tipo de moneda y la fase M.N.*/
TotalEnLetra = cad+moneda+centavos+" M.N.";
return TotalEnLetra;
}
var Cantidad = this.getField("Total");
event.value = covertirNumLetras(Cantidad.value...This is supposed to get the number from the "Total" field, convert it to text and display the result into the field the script is embedded in, but nothing shows up, not even an error message.
help!- you need to change it to Euros though********
- Ooops. Sorry, didn't realise you are in Mexico.********
- you need to change it to Euros though
- ********0
^ i get an alert window with pesos - but it's weird.
- i'm poor at javascript but can't you change the alert.window into a document.write?********
- Ooops. Sorry, didn't realise you want to PDF it. >:]********
- i'm poor at javascript but can't you change the alert.window into a document.write?
- ********0
*bitch slaps Corvo
- ********0
being completely out of my league here, and risking another slap, nothing in that code specifies the form output should be a PDF form value. Isn't that necessary if it is interpreting code? I'm asking because I think I've seen it somewhere, although I do not fully understand what I'm saying.
anyway try planetpdf.com
* jumps out of window.
- ********0
thanks Corvo, I understand what you're saying, the last tw lines should return the value to the field. I've used the same commands with other simpler functions.
I'll check the link and thanks again, you're the only one who replied unlike the rest of the people here, well, it's friday and it's late we should be getting drunk.
- ********0
I'm just posting because I think I've seen something like value=".PDF" or something similar in a js calc + html form somewhere. So I just thought: "the calc is already there and working; it just lacks the bridge for the doc/field output". That was my line of reasoning. Cheers.
- ********0
Yes, I finally got this bitch working.
Here's the final pdf if anyone cares to use it
http://www.colectivo2.com/nt/Fac…
It's a basic invoice form in spanish, it calculates sales tax and displays the total as both number and its text equivalent.
To do:
1. retrieve customer information from a database.
2. have it only show the totals when there's information.
- lajj0
when I enter 2 qty of 23$
the total is 52.90 (tax in.) but it return me this :
Cincuenta y Tres Pesos 90/100 M.N.- i'll check it out, it mus be rounding up or i screwed up the text somewhere********
- i'll check it out, it mus be rounding up or i screwed up the text somewhere
- ********0
ok, I fixed it!!