Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 917
Tony Avatar asked May 21 '15 19:05

Tony


1 Answers

You can use the columnDefs cellFilter option:

columnDefs: [
  {
    field: 'name',
    cellFilter: 'number: 2'
  }
]
like image 72
jme11 Avatar answered Feb 07 '23 01:02

jme11