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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maryjane28
    New Member
    • Feb 2012
    • 1

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

    private Product apples = new Product(50, 15.75);
    private Product oranges = new Product(80,12.5 0);
    private Product pomelos = new Product(25,95.2 5);
    Attached Files
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    If you are getting the input from the user as a text String then you can convert it to a double using

    [code=java]Double.parseDou ble(textInputVa lue);[/code]

    Comment

    Working...