hyperprop-charting-library 0.1.94 → 0.1.95
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.
|
@@ -2523,7 +2523,12 @@ function createChart(element, options = {}) {
|
|
|
2523
2523
|
const riskAmount = drawing.riskMode === "amount" ? drawing.risk : drawing.accountSize * (drawing.risk / 100);
|
|
2524
2524
|
const qtyRaw = riskAmount > 0 && stopDist > 0 ? riskAmount / (stopDist * effectivePointValue) : 0;
|
|
2525
2525
|
const hasMoney = qtyRaw > 0 && Number.isFinite(qtyRaw);
|
|
2526
|
-
const
|
|
2526
|
+
const qtyDigits = Math.min(Math.max(0, drawing.qtyPrecision), 2);
|
|
2527
|
+
let qtyText = "";
|
|
2528
|
+
if (hasMoney) {
|
|
2529
|
+
qtyText = qtyRaw.toFixed(qtyDigits);
|
|
2530
|
+
if (qtyText.includes(".")) qtyText = qtyText.replace(/\.?0+$/, "");
|
|
2531
|
+
}
|
|
2527
2532
|
const formatAmount = (value) => {
|
|
2528
2533
|
const abs = Math.abs(value);
|
|
2529
2534
|
if (abs >= 1e9) return `${(value / 1e9).toFixed(2)}B`;
|
|
@@ -2497,7 +2497,12 @@ function createChart(element, options = {}) {
|
|
|
2497
2497
|
const riskAmount = drawing.riskMode === "amount" ? drawing.risk : drawing.accountSize * (drawing.risk / 100);
|
|
2498
2498
|
const qtyRaw = riskAmount > 0 && stopDist > 0 ? riskAmount / (stopDist * effectivePointValue) : 0;
|
|
2499
2499
|
const hasMoney = qtyRaw > 0 && Number.isFinite(qtyRaw);
|
|
2500
|
-
const
|
|
2500
|
+
const qtyDigits = Math.min(Math.max(0, drawing.qtyPrecision), 2);
|
|
2501
|
+
let qtyText = "";
|
|
2502
|
+
if (hasMoney) {
|
|
2503
|
+
qtyText = qtyRaw.toFixed(qtyDigits);
|
|
2504
|
+
if (qtyText.includes(".")) qtyText = qtyText.replace(/\.?0+$/, "");
|
|
2505
|
+
}
|
|
2501
2506
|
const formatAmount = (value) => {
|
|
2502
2507
|
const abs = Math.abs(value);
|
|
2503
2508
|
if (abs >= 1e9) return `${(value / 1e9).toFixed(2)}B`;
|
package/dist/index.cjs
CHANGED
|
@@ -2523,7 +2523,12 @@ function createChart(element, options = {}) {
|
|
|
2523
2523
|
const riskAmount = drawing.riskMode === "amount" ? drawing.risk : drawing.accountSize * (drawing.risk / 100);
|
|
2524
2524
|
const qtyRaw = riskAmount > 0 && stopDist > 0 ? riskAmount / (stopDist * effectivePointValue) : 0;
|
|
2525
2525
|
const hasMoney = qtyRaw > 0 && Number.isFinite(qtyRaw);
|
|
2526
|
-
const
|
|
2526
|
+
const qtyDigits = Math.min(Math.max(0, drawing.qtyPrecision), 2);
|
|
2527
|
+
let qtyText = "";
|
|
2528
|
+
if (hasMoney) {
|
|
2529
|
+
qtyText = qtyRaw.toFixed(qtyDigits);
|
|
2530
|
+
if (qtyText.includes(".")) qtyText = qtyText.replace(/\.?0+$/, "");
|
|
2531
|
+
}
|
|
2527
2532
|
const formatAmount = (value) => {
|
|
2528
2533
|
const abs = Math.abs(value);
|
|
2529
2534
|
if (abs >= 1e9) return `${(value / 1e9).toFixed(2)}B`;
|
package/dist/index.js
CHANGED
|
@@ -2497,7 +2497,12 @@ function createChart(element, options = {}) {
|
|
|
2497
2497
|
const riskAmount = drawing.riskMode === "amount" ? drawing.risk : drawing.accountSize * (drawing.risk / 100);
|
|
2498
2498
|
const qtyRaw = riskAmount > 0 && stopDist > 0 ? riskAmount / (stopDist * effectivePointValue) : 0;
|
|
2499
2499
|
const hasMoney = qtyRaw > 0 && Number.isFinite(qtyRaw);
|
|
2500
|
-
const
|
|
2500
|
+
const qtyDigits = Math.min(Math.max(0, drawing.qtyPrecision), 2);
|
|
2501
|
+
let qtyText = "";
|
|
2502
|
+
if (hasMoney) {
|
|
2503
|
+
qtyText = qtyRaw.toFixed(qtyDigits);
|
|
2504
|
+
if (qtyText.includes(".")) qtyText = qtyText.replace(/\.?0+$/, "");
|
|
2505
|
+
}
|
|
2501
2506
|
const formatAmount = (value) => {
|
|
2502
2507
|
const abs = Math.abs(value);
|
|
2503
2508
|
if (abs >= 1e9) return `${(value / 1e9).toFixed(2)}B`;
|