]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/dimless-binary.pipe.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / dimless-binary.pipe.ts
index cf5d2cdec24b13eff1c65f26fe7688e54c803c78..f4cfd259e77139a062a424dc8013193b9e1db32a 100644 (file)
@@ -8,17 +8,12 @@ import { FormatterService } from '../services/formatter.service';
 export class DimlessBinaryPipe implements PipeTransform {
   constructor(private formatter: FormatterService) {}
 
-  transform(value: any): any {
-    return this.formatter.format_number(value, 1024, [
-      'B',
-      'KiB',
-      'MiB',
-      'GiB',
-      'TiB',
-      'PiB',
-      'EiB',
-      'ZiB',
-      'YiB'
-    ]);
+  transform(value: any, decimals: number = 1): any {
+    return this.formatter.format_number(
+      value,
+      1024,
+      ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'],
+      decimals
+    );
   }
 }