How do you convert numeric values into english words?

I am interested in creating a field in adobe acrobat that references a total dollar amount field. I want the java script to convert the numeric number into a written word, such as $59.59 as Fifty Nine and 59/100. I have no experience writing java script code and would really like some help on how this can get done. Its also important to embed in the programming that if their is no numeric value to reference, then nothing get referenced. This means an empty text box. Thanks for any help.

Im using the below script...... I'm a complete novice at this and helping a friend out with it.
Any info is appreciated.
aTens = [ "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
aOnes = [ "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine",
  "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen",
  "Nineteen" ];
function ConvertToHundreds(num)
   var cNum, nNum;
   var cWords = "";
   num %= 1000;
   if (num > 99) {
      /* Hundreds. */
      cNum = String(num);
      nNum = Number(cNum.charAt(0));
      cWords += aOnes[nNum] + " Hundred";
      num %= 100;
      if (num > 0)
         cWords += " and "
   if (num > 19) {
      /* Tens. */
      cNum = String(num);
      nNum = Number(cNum.charAt(0));
      cWords += aTens[nNum - 2];
      num %= 10;
      if (num > 0)
         cWords += "-";
   if (num > 0) {
      /* Ones and teens. */
      nNum = Math.floor(num);
      cWords += aOnes[nNum];
   return cWords;
function ConvertToWords(num)
   var aUnits = [ "Thousand", "Million", "Billion", "Trillion", "Quadrillion" ];
   var cWords = (num >= 1 && num < 2) ? "Dollar and " : "Dollars and ";
   var nLeft = Math.floor(num);
   for (var i = 0; nLeft > 0; i++) {
       if (nLeft % 1000 > 0) {
          if (i != 0)
             cWords = ConvertToHundreds(nLeft) + " " + aUnits[i - 1] + " " + cWords;
          else
             cWords = ConvertToHundreds(nLeft) + " " + cWords;
       nLeft = Math.floor(nLeft / 1000);
   num = Math.round(num * 100) % 100;
   if (num > 0)
      cWords += ConvertToHundreds(num) + " Cents";
   else
      cWords += "Zero Cents";
   return cWords;
You can use the following script for the custom calculation for the words field when the number field is named "Number":
event.value = "";
var f = this.getField("Number");
if(f.valueAsString != "") {
event.value = ConvertToWords(f.value);

Similar Messages

  • How do you convert a quotation into a purchase requisition?

    How do you convert a quotation into a purcahse requisition?

    Hi Ganesh
    But from ME51N in shows selection varaint it show RFQ for creation of Requisition but when you drop the RFQ to header for creation , it is not working..
    Chek again.
    Kishor
    Hi Christopher
    See Purchase requisition creation can happen without vendor and price details as well.
    so once you have finalised your vendor and price ,you can put the vendor and price details  in PR and then PR can go further for approval...there will be some manual work ,,but I do not think any more option available.
    hope its logical,.
    Kishor

  • How do you convert itune songs into ringtones

    how do you convert itunes music into ringtones

    Basically it is equivalent to transferring songs from an iPod to another iPod- impossible?
    Is my only option to transfer songs I purchased on the iPad to my Itune library on the PC and then connect my iPod as usual? Or is there any other more convenient way?

  • How do i convert a pdf into a word file, i have tried doing save as?

    how do i convert a pdf into a word file, i have tried doing save as?

    Hi Jack,
    What version of Acrobat are you using?
    You might need to go to File> Save As Other> Microsoft Word or choose 'Adobe PDF printer' from the File menu.
    Is save as option not functioning correctly? Do you get any specific error?
    Please let me know.
    Regards,
    Anubha

  • How can you convert a BufferedImage into a RenderedImage?

    I'm using the Histogram class and I'm wondering how I can easily convert my BufferedImage into a RenderedImage so that I can use this class.
    Of course, if I can use my BufferedImage object with the Histogram class, please let me know =D.

    If you have Acrobat 11, you'd select: File > Save As Other > Image
    and select one of the available image formats.

  • How do you convert this String into a double?

    Hi, in this code I want to convert String arg into a double. I'm trying to do this so that I can convert some string into a double in this calculator that I'm making. Here is the code:
    public class par {
    public static void main(String[] args) {
    String str = "351";
    double arg = new double(str); // should convert the string into a double
         System.out.println(arg);
         System.out.println(str);
    I keep getting errors in line 4, if any of you could help me out here I'll be thankful, i'm kinda new to java and my search for java's equivalent of alof() (its a function in C libraries that converts char[] into a double)lead me to this.
    Tony L.

    Use the Following:
    String num = "123.2";
    double d = Double.parseDouble(num);

  • How do you convert Raw files into jpeg.

      I have never shot in Raw before and I have a huge project due tomorrow. I need help Asap. What is the easiest way to convert Raw files into jpeg, can Light Room convert the files. I have tried so many different ways and nothing seems to work.

    michaelfragale wrote:
      I have never shot in Raw before and I have a huge project due tomorrow. I need help Asap. What is the easiest way to convert Raw files into jpeg
    It depends on the sofware you have.  ACR (Adobe Camera Raw) hosted by Bridge or by Photoshop can convert ("open") raw files, as can Lightroom.
    However, not all camera models are supported by all versions of the software.  We need to know the make and exact model of the camera that generated the raw files to advice you further.
    We can also assist you with the conversion through ACR hosted by Photoshop.
    Olease note that there are dedicated forums for Lightroom, for Adobe Camera Raw and for Bridge.
    Here's the list of which cameras are supported by each version of ACR.  Note that later versions supporte all camera models supported in previous versions of ACR.
    http://kb2.adobe.com/cps/407/kb407111.html
    Note that the latest version of ACR to run in CS4 is ACR 5.3;
    CS3 runs ACR 4.6;
    CS2 runs ACR 3.7;
    CS runs 2.4.

  • How do you convert arabic format to English format in InDesign so bullets are on the left side?

    I received a document from a client to work on that was created in InDesign with english format. For some reason, when they sent it to me the bullets were converted to arabic format, so they are on the left side not right. Is there an easy way to convert it back?

    You will likely get better program help in a program forum InDesign
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • IPhone SDK: How to convert Pixel values into Point values

    UIScrollView has a property called contentSize. This takes values in points. How do i convert Pixel values into Point Vales?
    -TRS

    As far as I can tell, they're the same - I know they are in Photoshop at least. My 57x57 point Tab Bar icon is also 57x57 pixels.
    Hope that helps

  • How do you convert adobe attachment to word or excel?

    How do you convert an adobe attachment to word or excel?

    Hi What,
    Here is a great guide to get you started: http://forums.adobe.com/docs/DOC-2412
    Hope it helps!
    Kind regards, Stacy

  • How to replace the char values into numeric in my string?

    Hi Friends,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    I mean How to replace the char values into numeric in my string?
    Thanks,
    Sridhar

    Hi Sridhar,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    So, if i understand you correctly, you want to replace all characters in a string with 9 as in the above example, irrespective of position of the character, if so try with the below code.
    DATA: l_str TYPE string.
    l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.
    REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.
    IF sy-subrc EQ 0.
      WRITE: l_str. "Result will be 9999999999999999912431243124312499999999
    ENDIF.
    Regards,
    Chen
    Edited by: Chen K V on Jun 13, 2011 12:36 PM

  • How do you convert a jpeg file into word document so i can edit it?

    How do you convert a jpeg file into word document so i can edit it?

    http://office.microsoft.com/en-us/mac-word-help/training-edit-pictures-in-office -for-mac-2011-RZ103709558.aspx

  • How do you convert an Autocad drawing into a pdf with Acrobat X Standard?

    How do you convert an Autocad drawing into a pdf with Acrobat X Standard?

    Something to try -
    Having installed Acrobat Standard you have the Adobe PDF virtual printer installed.
    From your authoring application do a "file-print" and select the Adobe PDF printer rather than the attached local or network printer / plotter.
    Be well...

  • How do you convert a jar file into a java file,  ?

    how do you convert a jar file into a java file ?
    I am new to Java ,but have a little experience in C++ and Visual Basic.
    I want to edit and maybe create my own mobile games that are written or converted into jar files.
    At the moment I am using Java NetBeans , and Easy Java( the java pad).
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?

    801283 wrote:
    how do you convert a jar file into a java file ?You generally don't. There exist decompilers, but if you're meant to have the source, you should either have it because you are the author, or you should be able to get it from the author.
    I am new to Java ,but have a little experience in C++ and Visual Basic.Does that experience include turning .exe files into C++ code? Because that's the equivalent of what you're asking
    I want to edit and maybe create my own mobile games that are written or converted into jar files.Eh?
    Are you saying you want to take existing games and modify them? If the creators allow you to modify their source, then they'll provide you with that source (the .java files). If you're allowed to add things but not modify, you don't need .java files. Just documentation, which, again, the creators should be providing.
    Or are you saying you want to create your own games and distribute them in jar files? If so, there's no need to turn jars into .java.
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?Why would you expect there to be one?

  • Plsql query converts numeric value or currency(rupees) to English words

    Hi,
    I Need a plsql procedure/function query that converts numeric value or currency(rupees) to English words.
    Please help .that is very very important and urgent for me.
    Thanks in advance.
    Regards,
    Karthik T

    that is very very important and urgent for me. Then help yourself by looking on all over internet :
    http://www.google.nl/search?hl=nl&q=oracle+numeric+word&meta=
    Or by using the search feature against the forum :
    http://forums.oracle.com/forums/search.jspa?threadID=&q=%2Bnumber+%2Bword&objID=f75&dateRange=all&userID=&numResults=15
    That would be faster.
    Nicolas.

Maybe you are looking for

  • Pdf problem with Preview - how to report to Apple?

    Hi, I have been having problems with certain PDFs and Preview. The PDFs in question are scientific papers obtained via JSTOR (they manage the supply of papers from a range of Journals). In Preview many JSTOR papers display very slowly - so slowly tha

  • Launching deluge from the .desktop file uses the sbin symlink... why?

    Can someone explain the following?  Launching deluge-gtk from the package provided deluge.desktop under lxde causes both deluge-gtk and deluged to run from the sbin symlink.  You can see it by a simple: % ps aux | grep deluge /usr/bin/python2 /usr/sb

  • How do I fix a proxy server error on my ipod?

    My ipod shows a proxy server error HTTP every time I try to connect to the internet.  It used to be fine and the started doing it about a week ago.  Does anyone know how to fix it?

  • Servlet and Object Serialization

    Hi, I am developing a routing server in Java 2 Instances of the same server will be running in 2 different data centers. The servers have a Jetty server embedded with a Servlet inside. Server 1 will use a GET method to talk to the Server 2 -> Servlet

  • Can't open web page because too many redirects

    Get the message Can"t open web page because too many redirects