Skip to content

Commit

Permalink
bitz-precise
Browse files Browse the repository at this point in the history
  • Loading branch information
frosty00 committed Apr 12, 2021
1 parent 9580c32 commit f5aaa57
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions js/bitz.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

const Exchange = require ('./base/Exchange');
const { ExchangeError, ArgumentsRequired, ExchangeNotAvailable, PermissionDenied, InvalidOrder, AuthenticationError, InsufficientFunds, OrderNotFound, DDoSProtection, OnMaintenance, RateLimitExceeded } = require ('./base/errors');
const Precise = require ('./base/Precise');

// ---------------------------------------------------------------------------

Expand Down Expand Up @@ -606,14 +607,11 @@ module.exports = class bitz extends Exchange {
if (market !== undefined) {
symbol = market['symbol'];
}
const price = this.safeNumber (trade, 'p');
const amount = this.safeNumber (trade, 'n');
let cost = undefined;
if (price !== undefined) {
if (amount !== undefined) {
cost = this.priceToPrecision (symbol, amount * price);
}
}
const priceString = this.safeString (trade, 'p');
const amountString = this.safeString (trade, 'n');
const price = this.parseNumber (priceString);
const amount = this.parseNumber (amountString);
const cost = this.parseNumber (Precise.stringMul (priceString, amountString));
const side = this.safeString (trade, 's');
return {
'timestamp': timestamp,
Expand Down

0 comments on commit f5aaa57

Please sign in to comment.