cancel
Showing results for 
Search instead for 
Did you mean: 

Inter value displaying with comma in table

Former Member
0 Kudos

Hi Experts

I am displaying staff number in a table and the type of this is integer

It is getting displayed with comma seprated value

(for example if staff number is 23567 it is diaplaying 23,567)

I am not getting comma if i convert staff number to string

but to enable table sort i cannot convert this to string

Pls help me how to display integer value without comma in table

Thanks

Karthi D.

Edited by: karthi D on Nov 16, 2009 8:54 AM

Accepted Solutions (1)

Accepted Solutions (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Karthi D.

If I understand you correctly you need to do sorting by Integer column, right? If so you it's not necessary to convert the stuff numbers to string. Just sort them as usual Java objects:

public int compareTo(Integer n1, Integer n2) {
   return n1.compareTo(n2);
}

BR, Siarhei

Former Member
0 Kudos

Hi friend,

You can Also try this hope it will help.


 String s1 = "100,000";
    String s2 = "";
    NumberFormat nf = NumberFormat.getInstance(Locale.getDefault()); // make locale-specific
    try
    {
      int i1 = nf.parse(s1).intValue();
      System.out.println(i1+200);
    }
    catch (ParseException e)
    {
      e.printStackTrace();
    }
  }

Regards

Jeetendra.

Answers (0)