Can the convert function be called in an Angular template like covert{{item.size}}? If so, what is the correct syntax to use? Thank you.
<mat-cell *matCellDef="let item" fxHide fxShow.gt-xs fxShow.gt-md [matTooltip]="item.size">
<span *ngIf="!item.isFolder">covert{{item.size}}</span>
</mat-cell>
#code converter
convert(x){
const units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
let l = 0, n = parseInt(x, 10) || 0;
while(n >= 1024 && ++l){
n = n/1024;
}
return(n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]);
}