@barchart/portfolio-api-common 1.2.112 → 1.2.113
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.
|
@@ -983,7 +983,7 @@ module.exports = (() => {
|
|
|
983
983
|
}
|
|
984
984
|
|
|
985
985
|
function calculatePeriodPercent(realized, realizedBasis, unrealized, unrealizedBasis) {
|
|
986
|
-
const numerator =
|
|
986
|
+
const numerator = realized.add(unrealized);
|
|
987
987
|
const denominator = realizedBasis.add(unrealizedBasis);
|
|
988
988
|
|
|
989
989
|
return denominator.getIsZero() ? Decimal.ZERO : numerator.divide(denominator);
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -3443,7 +3443,7 @@ module.exports = (() => {
|
|
|
3443
3443
|
}
|
|
3444
3444
|
|
|
3445
3445
|
function calculatePeriodPercent(realized, realizedBasis, unrealized, unrealizedBasis) {
|
|
3446
|
-
const numerator =
|
|
3446
|
+
const numerator = realized.add(unrealized);
|
|
3447
3447
|
const denominator = realizedBasis.add(unrealizedBasis);
|
|
3448
3448
|
|
|
3449
3449
|
return denominator.getIsZero() ? Decimal.ZERO : numerator.divide(denominator);
|
|
@@ -4107,7 +4107,7 @@ module.exports = (() => {
|
|
|
4107
4107
|
if (currentSummary) {
|
|
4108
4108
|
const period = currentSummary.period;
|
|
4109
4109
|
|
|
4110
|
-
returnRef = currentSummary.end.basis;
|
|
4110
|
+
returnRef = currentSummary.end.basis.absolute();
|
|
4111
4111
|
} else {
|
|
4112
4112
|
returnRef = Decimal.ZERO;
|
|
4113
4113
|
}
|