Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6875265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:18:02+00:00 2026-05-27T04:18:02+00:00

How to get the sum of Doubles that where parsed from a JTable ?

  • 0

How to get the sum of Doubles that where parsed from a JTable?

I’m Building a Client/Server Application, and I’m Stuck on a Little issue.

I want get the sum of values of a column in a JTable, this column contains String objects with #,## format, so when I try to parse them into doubles with a loop I get this error:

java.lang.NumberFormatException: For input string: "0,55"

Here is the JTable image:

enter image description here

And here is the code that I tried so far:

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt)    {                                          

    Double summl = 0.0;

    for(int i = 0; i < jTable1.getRowCount(); i++){
        summl=summl+Double.parseDouble(jTable1.getValueAt(i,5).toString());
    }
     System.out.println("summl = "+summl);
   }  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:18:02+00:00Added an answer on May 27, 2026 at 4:18 am

    I think the problem is with the comma in the number. You should try to parse the numbers using NumberFormat class.

    E.G.:

    public static void main(String[] args) {
            NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH); //Set the proper locale here
    
            try {
                Double myDouble = (Double)nf.parse("0,55");
                System.out.println(myDouble);
            } catch (ParseException e) {
                e.printStackTrace();
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

yes i want to get a child window of another application. Give me Sum
I am trying to get the sum(comprate) for only max(effdt) having max(id) from the
I want to get N random numbers whose sum is a value. For example,
The two programs below get n integers from file and calculates the sum of
I want a function that reads in a file and returns the sum of
I have a function that uses LINQ to get data from the database and
My Java assignment is to to write a Java application that uses data from
How would I get the SUM of the mutual field here? SELECT first_user_id, mutual
I have a report where I'm trying to get the sum of a dynamic
I'm trying to use the SUMPRODUCT formula to get the sum of money (O

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.