Skip to content

Instantly share code, notes, and snippets.

@nilsandrey
Created September 16, 2021 12:57
Show Gist options
  • Save nilsandrey/ee2c5237a0ed8fabb2b1704c2f2ad91c to your computer and use it in GitHub Desktop.
Save nilsandrey/ee2c5237a0ed8fabb2b1704c2f2ad91c to your computer and use it in GitHub Desktop.
to-gb.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'toGb'
})
export class ToGbPipe implements PipeTransform {
transform(value: number, args?: any): string {
return (value / 1073741824).toFixed(2).toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment