aspose file tools*
The moose likes Beginning Java and the fly likes Command Line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Command Line" Watch "Command Line" New topic
Author

Command Line

Kabs Pvt
Greenhorn

Joined: Oct 31, 2001
Posts: 3
May i know plz if i entered a value through command line
java class_name 25
then the complier will print Twenty Five

Complier will print In words is it possible for me, cindy will you tell me please.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
There is no built in java API to do this (ie. you have to write the algorithm yourself).
Go to google and try searching on "numbers to words" or "cheque printer" algorithms.
Anyway here is a VB example to get you started.
http://www.citilink.com/~jgarrick/vbasic/tips/num2word.html
James.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Kabs
The command line arguments supplied to a program are sent to the main method as an array of Strings. So, if you entered java class_name 25 then the variable args[0] would hold the String "25". I dont know of any standard way to convert the "25" to the words "twenty-five". Someone else may know of a package out there that does this or you may have to write it yourself.
hope that helps


------------------
Dave
Sun Certified Programmer for the Java� 2 Platform


Dave
 
 
subject: Command Line