@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 = realizedBasis.add(unrealized);
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);
@@ -650,7 +650,7 @@ module.exports = (() => {
650
650
  if (currentSummary) {
651
651
  const period = currentSummary.period;
652
652
 
653
- returnRef = currentSummary.end.basis;
653
+ returnRef = currentSummary.end.basis.absolute();
654
654
  } else {
655
655
  returnRef = Decimal.ZERO;
656
656
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.2.112",
3
+ "version": "1.2.113",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -3443,7 +3443,7 @@ module.exports = (() => {
3443
3443
  }
3444
3444
 
3445
3445
  function calculatePeriodPercent(realized, realizedBasis, unrealized, unrealizedBasis) {
3446
- const numerator = realizedBasis.add(unrealized);
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
  }