Browse Source

web-ui: Update explorerCurrency pipe to fix 8 decimals (#81)

prometheus-integration
jonsadev 6 years ago
parent
commit
7d1b18619a
  1. 9
      web-ui/src/app/pipes/explorer-currency.pipe.ts

9
web-ui/src/app/pipes/explorer-currency.pipe.ts

@ -6,6 +6,13 @@ import { Config } from '../config';
})
export class ExplorerCurrencyPipe implements PipeTransform {
transform(currency: any): string {
return `${ currency } ${ Config.currentCurrency }`;
let currencyNumber: number;
if (typeof(currency) === 'number') {
currencyNumber = currency;
} else if (typeof(currency) === 'string') {
currencyNumber = parseFloat(currency);
}
return `${ currencyNumber.toFixed(8) } ${ Config.currentCurrency }`;
}
}

Loading…
Cancel
Save