Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: convert numbers to text?

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Location
    Ireland
    Posts
    3
    My Mood
    Sleepy
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default convert numbers to text?

    This should be a simple program for some of you, I must convert an input of any number between 1 and 100 to it's text and output it to screen, for example, if user enters 24, I output "twenty four" etc, any suggestions? or is it a case of entering a lot of data into my programme? I'm a beginner!!!!
    Thanks in advance for any replies.


  2. #2
    Member llowe29's Avatar
    Join Date
    Jul 2013
    Posts
    116
    My Mood
    Tired
    Thanks
    9
    Thanked 5 Times in 5 Posts

    Default Re: convert numbers to text?

    Please read the article on why we cant spoonfeed, and actually make an attempt.

  3. #3
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: convert numbers to text?

    Use arrays of Strings: "one", "two" etc and "twenty", "thirty" etc.
    Perform math on the entered number to get the index of the array.
    Improving the world one idiot at a time!

  4. The Following User Says Thank You to Junky For This Useful Post:

    Sinead (November 13th, 2013)

  5. #4
    Junior Member
    Join Date
    Nov 2013
    Location
    Ireland
    Posts
    3
    My Mood
    Sleepy
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: convert numbers to text?

    Wasn't looking for the answer, wanted to know if it was possible, ur quick to assume I need spoonfeeding...

Similar Threads

  1. How to convert .gif text into .txt or .doc file in java
    By m.vinay09@gmail.com in forum File I/O & Other I/O Streams
    Replies: 5
    Last Post: May 24th, 2013, 02:48 AM
  2. convert text to speech with lip sync
    By swarna in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 11th, 2013, 11:40 AM
  3. Convert decimal values to english text
    By tqa in forum Java Theory & Questions
    Replies: 5
    Last Post: May 10th, 2012, 03:20 AM
  4. Convert Text files to XML
    By HelloAll in forum Java Theory & Questions
    Replies: 1
    Last Post: February 2nd, 2011, 05:01 AM
  5. Convert text to excel
    By mamta_techie in forum JDBC & Databases
    Replies: 1
    Last Post: December 27th, 2010, 12:15 PM