diff --git a/frontend/src/app/bisq/bisq-transaction/bisq-transaction.component.html b/frontend/src/app/bisq/bisq-transaction/bisq-transaction.component.html
index 172ac6861..064a2ef9f 100644
--- a/frontend/src/app/bisq/bisq-transaction/bisq-transaction.component.html
+++ b/frontend/src/app/bisq/bisq-transaction/bisq-transaction.component.html
@@ -67,7 +67,7 @@
Fee per vByte |
- {{ tx.fee / (tx.weight / 4) | number : '1.1-1' }} sat/vB
+ {{ tx.fee / (tx.weight / 4) | feeRounding }} sat/vB
|
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html
index 529400540..c4d8522a2 100644
--- a/frontend/src/app/components/transaction/transaction.component.html
+++ b/frontend/src/app/components/transaction/transaction.component.html
@@ -168,7 +168,7 @@
|
- {{ cpfpInfo.bestDescendant.fee / (cpfpInfo.bestDescendant.weight / 4) | number : '1.1-1' }} sat/vB |
+ {{ cpfpInfo.bestDescendant.fee / (cpfpInfo.bestDescendant.weight / 4) | feeRounding }} sat/vB |
|
@@ -181,7 +181,7 @@
|
- {{ cpfpTx.fee / (cpfpTx.weight / 4) | number : '1.1-1' }} sat/vB |
+ {{ cpfpTx.fee / (cpfpTx.weight / 4) | feeRounding }} sat/vB |
|
@@ -331,7 +331,7 @@
Fee rate |
- {{ tx.feePerVsize | number : '1.1-1' }} sat/vB
+ {{ tx.feePerVsize | feeRounding }} sat/vB
@@ -342,7 +342,7 @@
Effective fee rate |
- {{ tx.effectiveFeePerVsize | number : '1.1-1' }} sat/vB
+ {{ tx.effectiveFeePerVsize | feeRounding }} sat/vB
diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.html b/frontend/src/app/components/transactions-list/transactions-list.component.html
index a56161cb9..2581107fe 100644
--- a/frontend/src/app/components/transactions-list/transactions-list.component.html
+++ b/frontend/src/app/components/transactions-list/transactions-list.component.html
@@ -209,7 +209,7 @@
- {{ tx.fee / (tx.weight / 4) | number : '1.1-1' }} sat/vB – {{ tx.fee | number }} sat
+ {{ tx.fee / (tx.weight / 4) | feeRounding }} sat/vB – {{ tx.fee | number }} sat
diff --git a/frontend/src/app/components/tx-fee-rating/tx-fee-rating.component.html b/frontend/src/app/components/tx-fee-rating/tx-fee-rating.component.html
index e4d74520f..09062ed79 100644
--- a/frontend/src/app/components/tx-fee-rating/tx-fee-rating.component.html
+++ b/frontend/src/app/components/tx-fee-rating/tx-fee-rating.component.html
@@ -1,3 +1,3 @@
Optimal
- Overpaid {{ overpaidTimes }}x
- Overpaid {{ overpaidTimes }}x
+ Overpaid {{ overpaidTimes }}x
+ Overpaid {{ overpaidTimes }}x
diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html
index 6df13027a..47990f639 100644
--- a/frontend/src/app/dashboard/dashboard.component.html
+++ b/frontend/src/app/dashboard/dashboard.component.html
@@ -115,7 +115,7 @@
{{ transaction.txid | shortenString : 10 }} |
Confidential |
|
- {{ transaction.fee / transaction.vsize | number : '1.1-1' }} sat/vB |
+ {{ transaction.fee / transaction.vsize | feeRounding }} sat/vB |
| |
@@ -168,7 +168,7 @@
Minimum fee
Purging
- 0.00001">< {{ mempoolInfoData.value.memPoolInfo.mempoolminfee * 100000 | number : '1.1-1' }} sat/vB
+ 0.00001">< {{ mempoolInfoData.value.memPoolInfo.mempoolminfee * 100000 | feeRounding }} sat/vB
diff --git a/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.spec.ts b/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.spec.ts
new file mode 100644
index 000000000..0328ff748
--- /dev/null
+++ b/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.spec.ts
@@ -0,0 +1,8 @@
+import { FeeRoundingPipe } from './fee-rounding.pipe';
+
+describe('FeeRoundingPipe', () => {
+ it('create an instance', () => {
+ const pipe = new FeeRoundingPipe();
+ expect(pipe).toBeTruthy();
+ });
+});
diff --git a/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts b/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts
new file mode 100644
index 000000000..6a050a9f7
--- /dev/null
+++ b/frontend/src/app/shared/pipes/fee-rounding/fee-rounding.pipe.ts
@@ -0,0 +1,15 @@
+import { Pipe, PipeTransform } from "@angular/core";
+
+@Pipe({
+ name: "feeRounding",
+})
+export class FeeRoundingPipe implements PipeTransform {
+ transform(fee: number): string {
+ if (fee >= 100) {
+ return fee.toFixed(0);
+ } else if (fee < 10) {
+ return fee.toFixed(2);
+ }
+ return fee.toFixed(1);
+ }
+}
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index c95e28a4f..ead7b20c2 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -5,6 +5,7 @@ import { ShortenStringPipe } from './pipes/shorten-string-pipe/shorten-string.pi
import { CeilPipe } from './pipes/math-ceil/math-ceil.pipe';
import { Hex2asciiPipe } from './pipes/hex2ascii/hex2ascii.pipe';
import { Decimal2HexPipe } from './pipes/decimal2hex/decimal2hex.pipe';
+import { FeeRoundingPipe } from './pipes/fee-rounding/fee-rounding.pipe';
import { AsmStylerPipe } from './pipes/asm-styler/asm-styler.pipe';
import { AbsolutePipe } from './pipes/absolute/absolute.pipe';
import { RelativeUrlPipe } from './pipes/relative-url/relative-url.pipe';
@@ -44,6 +45,7 @@ import { ColoredPriceDirective } from './directives/colored-price.directive';
CeilPipe,
ShortenStringPipe,
Decimal2HexPipe,
+ FeeRoundingPipe,
ColoredPriceDirective,
],
imports: [
@@ -87,6 +89,7 @@ import { ColoredPriceDirective } from './directives/colored-price.directive';
CeilPipe,
ShortenStringPipe,
Decimal2HexPipe,
+ FeeRoundingPipe,
ColoredPriceDirective,
]
})