-1

In handsontable a column has data like this : 24999-99999 I want to convert like this comma separated: 24,999-99,999

how can i acheive this for entire column in angular js handson table ???

Handsontable full.min.js version : 0.28.4 Angular js version : 1.4

  • @charlietfl I think you should not mark it as Duplicate , it's not JS formating , the question is about Handson table library, and the issue with formatting in this library is not similar to JS one – xelilof Dec 22 '17 at 14:02

1 Answers1

1

I guess you have to write your own render.

function numberRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
  var valueArray = value.split('-');
  var str = parseInt(valueArray[0]).toLocaleString('en-IN') + '-' + parseInt(valueArray[1]).toLocaleString('en-IN');
  TD.innerHTML = str;
}


columns: [
  {
    data: 'yourcolumn',
    renderer: numberRenderer
  }
]
Ashish
  • 1,111
  • 8
  • 18