Forums Register Login

Number Conversion Problem

+Pie Number of slices to send: Send
Dear All.

I am using JTable having values in column 3.
I am getting values from it using jTable.getValueAt(1,1).toString;
Then i use Double/Float/Integer/Long etc to convert data.
My data having values 999,999,999,999.99
Problem is that thru any of above option i get 9.9999999999999
in sum of different values. My jTable contents number of values positive and negative.

Can anyone help me where i m wrong or is there any other way to solve my this problem.

I am using the same below method except Double.parseDouble(), Integer.parseInt() etc etc

+Pie Number of slices to send: Send
The problem is that the parse methods of Double, etc. all assume the String has no formatting elements excpet . Since yours does, you should use DecimalFormat to parse String values with , seperators.
http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1201 times.
Similar Threads
JTable and getValueAt(int, int)
Customizing JTable
EDITABLE JTable and SQL QUERY
jtable
JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:32:25.