brunano21 / angular-4-data-table

An Angular 5 data table, with pagination, sorting, expandable rows, row selection, etc. with basic accessibility support.
MIT License
11 stars 19 forks source link

pipe number to 2 dp in data-table-column #33

Closed angchoo closed 6 years ago

angchoo commented 6 years ago

Hi Brunano,

Thanks for fixing the header color. Great work!

I would like to know if we can pipe a number to 2 decimal places via data-table-column?

Best Regards

brunano21 commented 6 years ago

it has support for it. Like, for date you can do something like below:

<data-table-column
  [property]="'date'"
  [header]="'Date'"
  [sortable]="true">
  <ng-template #dataTableCell let-item="item">
     <span>{{ item.date | date:'yyyy-MM-dd' }}</span>
   </ng-template>
</data-table-column>
brunano21 commented 6 years ago

Closing this for inactivity. Please, feel free to reopen it if needed.