Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

problem on number to alphabet conversion

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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.
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!