Tony Tony - 4 months ago 106
AngularJS Question

How to format a number value in AngularJS ui-grid cell to two decimal?

I'm using Angularjs ui-grid and using the default settings, the question is how can I format the numbers to two decimal?

enter image description here

Answer

You can use the columnDefs cellFilter option:

columnDefs: [
  {
    field: 'name',
    cellFilter: 'number: 2'
  }
]