mirror of
https://github.com/mempool/mempool.git
synced 2025-03-13 11:36:07 +01:00
export bitcoinsatoshis pipe module, allow custom class for first part
This commit is contained in:
parent
676abf58fd
commit
2d7316942f
2 changed files with 3 additions and 2 deletions
|
@ -8,7 +8,7 @@ export class BitcoinsatoshisPipe implements PipeTransform {
|
|||
|
||||
constructor(private sanitizer: DomSanitizer) { }
|
||||
|
||||
transform(value: string): SafeHtml {
|
||||
transform(value: string, firstPartClass?: string): SafeHtml {
|
||||
const newValue = this.insertSpaces(parseFloat(value || '0').toFixed(8));
|
||||
const position = (newValue || '0').search(/[1-9]/);
|
||||
|
||||
|
@ -16,7 +16,7 @@ export class BitcoinsatoshisPipe implements PipeTransform {
|
|||
const secondPart = newValue.slice(position);
|
||||
|
||||
return this.sanitizer.bypassSecurityTrustHtml(
|
||||
`<span class="text-secondary">${firstPart}</span>${secondPart}`
|
||||
`<span class="${firstPartClass ? firstPartClass : 'text-secondary'}">${firstPart}</span>${secondPart}`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -365,6 +365,7 @@ import { OnlyVsizeDirective, OnlyWeightDirective } from './components/weight-dir
|
|||
TwitterWidgetComponent,
|
||||
TwitterLogin,
|
||||
BitcoinInvoiceComponent,
|
||||
BitcoinsatoshisPipe,
|
||||
|
||||
MempoolBlockOverviewComponent,
|
||||
ClockchainComponent,
|
||||
|
|
Loading…
Add table
Reference in a new issue