SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question I need help please!!!

    Please can someone help!!!
    The following script fragment will produce the seven times table, as shown.

    <SCRIPT LANGUAGE="JavaScript">
    var tableNumber = 7
    var thisResult = 0
    for ( var tableIndex = 1;
    tableIndex <= 12;
    tableIndex++) {
    thisResult = tableIndex * tableNumber
    document.write( tableIndex + " times " +
    tableNumber + " is " +
    thisResult + "<BR>")
    } <!-- End for -->
    </SCRIPT>


    How do I adapt the script so that it names the numbers, for example the last line of the table should be.

    twelve times seven is eighty four
    not
    12 times 7 is 84

    Thanx for anyone that can help me
    PS please write out the complete script to be executed!!!

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a pretty hefty piece of programming needed to do that. I have found something similar (converts currency to words - but you could pick up and modify the algorithm)

    http://www.experts-exchange.com/Prog..._20369023.html

    Good luck - I won't be writing that script during my lunch break


  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aye, not so simple. Here's one I remember seeing a while back...

    http://www.codingforums.com/showthre...&threadid=4577
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •