@barchart/portfolio-api-common 1.3.10 → 1.3.14
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.
|
@@ -155,14 +155,14 @@ module.exports = (() => {
|
|
|
155
155
|
f.total = t.dividend.amount;
|
|
156
156
|
f.rate = t.dividend.rate;
|
|
157
157
|
|
|
158
|
-
f.shares = t.amount.divide(t.dividend.rate)
|
|
158
|
+
f.shares = t.dividend.amount.divide(t.dividend.rate);
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
const distributionCashFormatter = (t, f) => {
|
|
162
162
|
f.total = t.dividend.amount;
|
|
163
163
|
f.rate = t.dividend.rate;
|
|
164
164
|
|
|
165
|
-
f.shares = t.amount.divide(t.dividend.rate)
|
|
165
|
+
f.shares = t.dividend.amount.divide(t.dividend.rate);
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
const dividendReinvestFormatter = (t, f) => {
|
|
@@ -249,6 +249,8 @@ module.exports = (() => {
|
|
|
249
249
|
};
|
|
250
250
|
|
|
251
251
|
const splitFormatter = (t, f) => {
|
|
252
|
+
f.boughtSold = t.quantity;
|
|
253
|
+
|
|
252
254
|
f.rate = t.split.numerator.divide(t.split.denominator);
|
|
253
255
|
|
|
254
256
|
f.shares = t.snapshot.open.subtract(t.quantity);
|
|
@@ -997,7 +997,7 @@ module.exports = (() => {
|
|
|
997
997
|
const format = group._dataFormat;
|
|
998
998
|
|
|
999
999
|
const numerator = actual.unrealized;
|
|
1000
|
-
const denominator = actual.basis;
|
|
1000
|
+
const denominator = actual.basis.absolute();
|
|
1001
1001
|
|
|
1002
1002
|
if (denominator.getIsZero()) {
|
|
1003
1003
|
actual.unrealizedPercent = Decimal.ZERO;
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -3565,7 +3565,7 @@ module.exports = (() => {
|
|
|
3565
3565
|
const format = group._dataFormat;
|
|
3566
3566
|
|
|
3567
3567
|
const numerator = actual.unrealized;
|
|
3568
|
-
const denominator = actual.basis;
|
|
3568
|
+
const denominator = actual.basis.absolute();
|
|
3569
3569
|
|
|
3570
3570
|
if (denominator.getIsZero()) {
|
|
3571
3571
|
actual.unrealizedPercent = Decimal.ZERO;
|