We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3feafb8 commit 6adfa17Copy full SHA for 6adfa17
src/structures/Amount.ts
@@ -86,16 +86,18 @@ export class Amount {
86
.toFixed(unit.optionalDecimals ?? unit.scale)
87
.replace(/\.?0+$/, '');
88
89
+ const baseString = `${emoji ? `${emoji} ` : ''}**${preparedValue} ${
90
+ unit.singular
91
+ }**`;
92
+
93
if (includeUsd && usdValue) {
94
const displayedUsd = usdValue.lt(0.01)
95
? usdValue.toFixed(4)
96
: usdValue.toFixed(2);
97
- return `**${emoji ? `${emoji} ` : ''} ${preparedValue} ${
- unit.singular
- } **${`(≈ $${displayedUsd})`}`;
98
+ return baseString + ` (≈ $${displayedUsd})`;
99
} else {
- return `**${emoji ? `${emoji} ` : ''} ${preparedValue} ${unit.singular}`;
100
+ return baseString;
101
}
102
103
0 commit comments