Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to solve java.lang.NumberFormatException: For input string: "396.00"

  1. #1
    Junior Member
    Join Date
    Nov 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to solve java.lang.NumberFormatException: For input string: "396.00"

    I have made a small application in java. I want to insert supplier payment in mysql database.Now the issue is when i try to subtract total balance with total payment and enter in balance column. so it give me error like java.lang.NumberFormatException: For input string: "396.00" so how i can solve it

    if(jCheckBox1.isSelected())
    {
    String bx="Insert into supplierpaymenttable(Supplier_ID,SupplierInvoice_I D,User_ID,InvoiceNo,TotalAmount,PaymentAmount,Rema iningBalance) VALUES (?,?,?,?,?,?,?)";



    PreparedStatement pay=conn.prepareStatement(bx);
    int k=Integer.parseInt(jTextField5.getText());
    int cx=k-k;


    pay.setString(1,String.valueOf(supplier));
    pay.setString(2,String.valueOf(det));
    pay.setString(3,"1");
    pay.setString(4, String.valueOf(invoie));
    pay.setInt(5, Integer.valueOf(jTextField5.getText()));
    pay.setInt(6, Integer.valueOf(jTextField5.getText()));

    pay.setInt(7,Integer.valueOf(cx));
    int rsdets= pay.executeUpdate();
    }

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,386
    Thanks
    54
    Thanked 2,637 Times in 2,587 Posts

    Default Re: How to solve java.lang.NumberFormatException: For input string: "396.00"

    it give me error like java.lang.NumberFormatException: For input string: "396.00"
    What statement gives that error?

    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 10
    Last Post: July 15th, 2021, 11:45 AM
  2. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  3. Replies: 3
    Last Post: December 7th, 2011, 02:03 AM
  4. Replies: 1
    Last Post: January 15th, 2010, 01:32 AM
  5. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 08:35 AM

Tags for this Thread