Grid column with Double value with Comma and Sortable

Hi ,

I am using Vaadin 8.4.3 . Am Trying to add Double value with Comma separated.

EX: IF Double d=236582;

I want to show the value d as 2,36,582 but keeping the data type as Double only and the column values should sortable.
Right now I am using : DecimalFormat(“##,##,##,##,##0.0000000”).format(DoubleValue); which returns String which is failing in sorting.

So Can anyone please help me to find is there any way to fix this.

Thanks

Hello Nithesh,

you can work with the double on the server side and on the client side, you can use JS to format the double number.

_formatNumber(val) {
   console.log('val:', val)
   val = Number.parseInt(val);
   console.log('val:', val)
   return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}