@kibibot/cli 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,11 +67,18 @@ export function fmtBalance(value, symbol) {
67
67
  */
68
68
  export function fmtUsd(value) {
69
69
  if (!value)
70
- return chalk.dim('$0.00');
70
+ return chalk.dim('');
71
71
  const num = parseFloat(value);
72
- if (isNaN(num))
73
- return chalk.dim('$0.00');
74
- return `$${num.toFixed(2)}`;
72
+ if (isNaN(num) || num === 0)
73
+ return chalk.dim('');
74
+ if (num >= 1)
75
+ return `$${num.toFixed(2)}`;
76
+ // For small numbers, show enough significant digits
77
+ const str = num.toFixed(10);
78
+ const match = str.match(/^0\.(0*)/);
79
+ const leadingZeros = match ? match[1].length : 0;
80
+ const sigFigs = Math.max(leadingZeros + 4, 2);
81
+ return `$${num.toFixed(sigFigs)}`;
75
82
  }
76
83
  /**
77
84
  * Format a date string.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kibibot/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "KibiBot CLI — deploy tokens, check balances, and manage your AI agent from the terminal",
5
5
  "type": "module",
6
6
  "bin": {