hedgequantx 2.5.16 → 2.5.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.5.16",
3
+ "version": "2.5.17",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -79,30 +79,26 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
79
79
 
80
80
  console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
81
81
 
82
- // Menu in 3 columns - centered
83
- const colWidth = Math.floor(W / 3);
84
-
82
+ // Menu in 3 columns - evenly distributed
85
83
  const menuRow3 = (col1, col2, col3) => {
86
84
  const c1Plain = col1.replace(/\x1b\[[0-9;]*m/g, '');
87
85
  const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
88
86
  const c3Plain = col3.replace(/\x1b\[[0-9;]*m/g, '');
89
87
 
90
- // Center each column within its space
91
- const c1LeftPad = Math.floor((colWidth - c1Plain.length) / 2);
92
- const c1RightPad = colWidth - c1Plain.length - c1LeftPad;
93
-
94
- const c2LeftPad = Math.floor((colWidth - c2Plain.length) / 2);
95
- const c2RightPad = colWidth - c2Plain.length - c2LeftPad;
88
+ // Total content length
89
+ const totalContent = c1Plain.length + c2Plain.length + c3Plain.length;
90
+ // Available space for padding
91
+ const totalPadding = W - totalContent;
92
+ // Divide into 4 gaps: left margin, between 1-2, between 2-3, right margin
93
+ const gap = Math.floor(totalPadding / 4);
94
+ const extraPad = totalPadding - (gap * 4);
96
95
 
97
- const c3Width = W - colWidth * 2;
98
- const c3LeftPad = Math.floor((c3Width - c3Plain.length) / 2);
99
- const c3RightPad = c3Width - c3Plain.length - c3LeftPad;
96
+ const line = ' '.repeat(gap) +
97
+ col1 + ' '.repeat(gap) +
98
+ col2 + ' '.repeat(gap) +
99
+ col3 + ' '.repeat(gap + extraPad);
100
100
 
101
- console.log(chalk.cyan('║') +
102
- ' '.repeat(Math.max(0, c1LeftPad)) + col1 + ' '.repeat(Math.max(0, c1RightPad)) +
103
- ' '.repeat(Math.max(0, c2LeftPad)) + col2 + ' '.repeat(Math.max(0, c2RightPad)) +
104
- ' '.repeat(Math.max(0, c3LeftPad)) + col3 + ' '.repeat(Math.max(0, c3RightPad)) +
105
- chalk.cyan('║'));
101
+ console.log(chalk.cyan('║') + line + chalk.cyan('║'));
106
102
  };
107
103
 
108
104
  const centerLine = (content) => {