By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

how can i put the price by decimal on the input. how will it work? Please help me.

P: 1
private Product apples = new Product(50, 15.75);
private Product oranges = new Product(80,12.50);
private Product pomelos = new Product(25,95.25);
Attached Images
File Type: jpg Untitled.jpg (41.4 KB, 101 views)
Feb 20 '12 #1
Share this Question
Share on Google+
1 Reply

P: 13,264
If you are getting the input from the user as a text String then you can convert it to a double using

Expand|Select|Wrap|Line Numbers
  1. Double.parseDouble(textInputValue);
Feb 20 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.