@barchart/portfolio-api-common 1.0.97 → 1.0.98

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.
@@ -17,7 +17,7 @@ module.exports = (() => {
17
17
  this._parent = parent || null;
18
18
 
19
19
  this._items = items;
20
- this._currency = currency;
20
+ this._currency = currency || Currency.CAD;
21
21
 
22
22
  this._description = description;
23
23
 
@@ -66,7 +66,7 @@ module.exports = (() => {
66
66
  item.registerPriceChangeHandler((data, sender) => {
67
67
  if (this._single) {
68
68
  this._dataActual.currentPrice = data.currentPrice;
69
- this._dataFormat.currentPrice = format(data.currentPrice, sender.position.instrument.currency);
69
+ this._dataFormat.currentPrice = formatCurrency(data.currentPrice, sender.position.instrument.currency);
70
70
  } else {
71
71
  this._dataActual.currentPrice = null;
72
72
  this._dataFormat.currentPrice = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1018,7 +1018,7 @@ module.exports = (() => {
1018
1018
  this._parent = parent || null;
1019
1019
 
1020
1020
  this._items = items;
1021
- this._currency = currency;
1021
+ this._currency = currency || Currency.CAD;
1022
1022
 
1023
1023
  this._description = description;
1024
1024
 
@@ -1067,7 +1067,7 @@ module.exports = (() => {
1067
1067
  item.registerPriceChangeHandler((data, sender) => {
1068
1068
  if (this._single) {
1069
1069
  this._dataActual.currentPrice = data.currentPrice;
1070
- this._dataFormat.currentPrice = format(data.currentPrice, sender.position.instrument.currency);
1070
+ this._dataFormat.currentPrice = formatCurrency(data.currentPrice, sender.position.instrument.currency);
1071
1071
  } else {
1072
1072
  this._dataActual.currentPrice = null;
1073
1073
  this._dataFormat.currentPrice = null;