diff --git a/web/src/app/[cat]/InteractionClient.tsx b/web/src/app/[cat]/InteractionClient.tsx
index ed76d092..7d49575f 100644
--- a/web/src/app/[cat]/InteractionClient.tsx
+++ b/web/src/app/[cat]/InteractionClient.tsx
@@ -70,7 +70,16 @@ export default function InteractionClient() {
const formatNumber = (num: number, decimals: number = 4): string => {
if (num === 0) return "0";
if (num < 0.0001) return num.toExponential(2);
- return num.toFixed(decimals);
+
+ // Format with specified decimals
+ const formatted = num.toFixed(decimals);
+
+ // Remove trailing zeros after decimal point
+ if (formatted.includes('.')) {
+ return formatted.replace(/\.?0+$/, '');
+ }
+
+ return formatted;
};
const [isLoading, setIsLoading] = useState(true);
@@ -539,11 +548,13 @@ export default function InteractionClient() {
try {
await fetchTokenDetailsFromBlockchain();
toast.success('Token details synced successfully');
+ // Force re-initialization to refresh all data
+ await initializeTokenDetails();
} catch (error) {
console.error('Manual sync failed:', error);
toast.error('Failed to sync token details. Please try again.');
}
- }, [tokenAddress, chainId, address, isOnline, fetchTokenDetailsFromBlockchain]);
+ }, [tokenAddress, chainId, address, isOnline, fetchTokenDetailsFromBlockchain, initializeTokenDetails]);
useEffect(() => {
if (isInitialized && tokenAddress && chainId && address) {
@@ -1116,7 +1127,7 @@ export default function InteractionClient() {
Max Supply
- {tokenDetails.maxSupply} {tokenDetails.tokenSymbol}
+ {formatNumber(tokenDetails.maxSupply)} {tokenDetails.tokenSymbol}
Threshold Supply
- {tokenDetails.thresholdSupply} {tokenDetails.tokenSymbol}
+ {formatNumber(tokenDetails.thresholdSupply)} {tokenDetails.tokenSymbol}
Expansion Rate
- {tokenDetails.maxExpansionRate} %
+ {formatNumber(tokenDetails.maxExpansionRate)}%