Add pipe for converting token values to Wei standards.
This commit is contained in:
8
src/app/shared/_pipes/token-ratio.pipe.ts
Normal file
8
src/app/shared/_pipes/token-ratio.pipe.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
|
||||
@Pipe({name: 'tokenRatio'})
|
||||
export class TokenRatioPipe implements PipeTransform {
|
||||
transform(value: any, ...args): any {
|
||||
return Number(value) / Math.pow(10, 18);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user