• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem on number to alphabet conversion

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

i was tring to figure out a problem which is:- if we had anumber like 123 then it must be converted to one hundred twenty three. though i figure it out it seems to be very less efficient and clumsy. can smbody give me an idea to make it in a good way, which looks more arranged and object oriented.

regards,

Sachin.
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post what ever you have done so far. People will help you in making the code better.
 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
main acctually i have just test my program, but it's not working properly, so i have decided to make it again frm scrach with sm new logic. now can sm1 help me out. previously i make an array of string like one, two, three ect. til nine and use it to genetrate value. but wht abt ten twenty, and many things like that.

i think i am confused, can smbody make a better approach.
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i fnd ths msgs pr8ty hrd 2 read...

is it such a big timesaver for you to write some1 instead of someone? many people here are non-native speakers and find this pretty hard to read.

and to be honest - some of the worst abbrevation-users in this forum are doubling as worst english writers, which makes it extra hard to read... :-(

many thanks,
jan
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Up to 20 or maybe from 10 to 20 you pretty much have to code as special cases. After that you can use modulo and division or just substringing to break out the tens, hundreds, thousands and so on, just as you would do using pencil & paper to write numbers. Share what you have with us and we'll be glad to see if we can help.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic