diff --git a/packages/profile/src/components/inventory/token/send.tsx b/packages/profile/src/components/inventory/token/send.tsx
index 274a868ac..7b983bbeb 100644
--- a/packages/profile/src/components/inventory/token/send.tsx
+++ b/packages/profile/src/components/inventory/token/send.tsx
@@ -112,6 +112,21 @@ export function SendToken() {
{ enabled: t && ["ETH", "STRK"].includes(t.meta.symbol) && !!amount },
);
+ const countervalueFormatted = useMemo(() => {
+ if (!countervalue) return undefined;
+ // Catch prefix until number
+ let prefix = "";
+ for (const char of countervalue.formatted) {
+ if (!isNaN(parseInt(char))) {
+ break;
+ }
+ prefix += char;
+ }
+ return `${prefix}${parseFloat(
+ countervalue.formatted.replace(prefix, ""),
+ ).toLocaleString()}`;
+ }, [countervalue]);
+
if (!t) {
return null;
}
@@ -127,7 +142,7 @@ export function SendToken() {
}
>
}
icon={
Amount
Balance:
-
- {t.balance.formatted} {t.meta.symbol}
+
+ form.setValue(
+ "amount",
+ parseFloat(t.balance.formatted),
+ )
+ }
+ >
+ {parseFloat(t.balance.formatted).toLocaleString()}{" "}
+ {t.meta.symbol}
@@ -171,14 +195,14 @@ export function SendToken() {
{countervalue && (
- {countervalue.formatted}
+ {countervalueFormatted}
)}
diff --git a/packages/profile/src/components/inventory/token/token.tsx b/packages/profile/src/components/inventory/token/token.tsx
index 78e762e2c..f2d850815 100644
--- a/packages/profile/src/components/inventory/token/token.tsx
+++ b/packages/profile/src/components/inventory/token/token.tsx
@@ -106,6 +106,21 @@ function ERC20() {
{ enabled: t && ["ETH", "STRK"].includes(t.meta.symbol) },
);
+ const countervalueFormatted = useMemo(() => {
+ if (!countervalue) return undefined;
+ // Catch prefix until number
+ let prefix = "";
+ for (const char of countervalue.formatted) {
+ if (!isNaN(parseInt(char))) {
+ break;
+ }
+ prefix += char;
+ }
+ return `${prefix}${parseFloat(
+ countervalue.formatted.replace(prefix, ""),
+ ).toLocaleString()}`;
+ }, [countervalue]);
+
const compatibility = useMemo(() => {
if (!version) return false;
return compare(version, "0.4.0", ">=");
@@ -130,10 +145,10 @@ function ERC20() {
t.balance === undefined ? (
) : (
- t.balance.formatted
+ parseFloat(t.balance.formatted).toLocaleString()
)
} ${t.meta.symbol}`}
- description={countervalue && `${countervalue.formatted} (USD)`}
+ description={countervalueFormatted && `$${countervalueFormatted} (USD)`}
icon={
{
+ if (!countervalue) return undefined;
+ // Catch prefix until number
+ let prefix = "";
+ for (const char of countervalue.formatted) {
+ if (!isNaN(parseInt(char))) {
+ break;
+ }
+ prefix += char;
+ }
+ return `${prefix}${parseFloat(
+ countervalue.formatted.replace(prefix, ""),
+ ).toLocaleString()}`;
+ }, [countervalue]);
+
return (
-
{token.balance.formatted}
-
{token.meta.symbol}
+
{parseFloat(token.balance.formatted).toLocaleString()}
+
{token.meta.symbol}
- {countervalue && (
- {countervalue.formatted}
+ {countervalueFormatted && (
+ {countervalueFormatted}
)}