Commit b7bc79ba authored by dev0tion's avatar dev0tion

Add Stratis to coin notation pipe

parent 7c08b643
import { Pipe, PipeTransform } from '@angular/core';
import { GlobalService } from '../services/global.service';
@Pipe({
name: 'coinNotation'
})
export class CoinNotationPipe implements PipeTransform {
constructor (private globalService: GlobalService) {
this.setCoinUnit();
}
private coinUnit = "BTC";
private coinName = this.globalService.getCoinName();
private coinUnit: string;
private coinNotation: number;
private decimalLimit = 8;
......@@ -22,9 +27,26 @@ export class CoinNotationPipe implements PipeTransform {
case "uBTC":
temp = value / 100;
return temp.toFixed(this.decimalLimit) + " TuBTC";
case "STRAT":
temp = value / 100000000;
return temp.toFixed(this.decimalLimit) + " TSTRAT";
case "mSTRAT":
temp = value / 100000;
return temp.toFixed(this.decimalLimit) + " TmSTRAT";
case "uSTRAT":
temp = value / 100;
return temp.toFixed(this.decimalLimit) + " TuSTRAT";
}
}
}
setCoinUnit() {
if (this.coinName === "Bitcoin") {
this.coinUnit = "BTC";
} else if (this.coinName === "Stratis") {
this.coinUnit = "STRAT"
}
};
getCoinUnit() {
return this.coinUnit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment