wood burning stoves
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

Command Line

Kabs Pvt

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.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
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

Sun Certified Programmer for the Java� 2 Platform

I agree. Here's the link: http://aspose.com/file-tools
subject: Command Line
It's not a secret anymore!