Skip to content

Commit

Permalink
proper fix to dsx for zero division ccxt#1561
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jan 29, 2018
1 parent 93568e8 commit 0dbdc35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/dsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ module.exports = class dsx extends liqui {
let symbol = undefined;
if (market)
symbol = market['symbol'];
let average = this.safeFloat (ticker, 'avg');
if (typeof average !== 'undefined')
average = 1 / average;
return {
'symbol': symbol,
'timestamp': timestamp,
Expand All @@ -128,7 +131,7 @@ module.exports = class dsx extends liqui {
'last': this.safeFloat (ticker, 'last'),
'change': undefined,
'percentage': undefined,
'average': 1 / this.safeFloat (ticker, 'avg'),
'average': average,
'baseVolume': this.safeFloat (ticker, 'vol'),
'quoteVolume': this.safeFloat (ticker, 'vol_cur'),
'info': ticker,
Expand Down

0 comments on commit 0dbdc35

Please sign in to comment.