altangent / ccxws

WebSocket client for 38 cryptocurrency exchanges
MIT License
619 stars 187 forks source link

Huobi level 2 prices can have 12 significant digits #262

Open lostless13 opened 3 years ago

lostless13 commented 3 years ago

Price for L2 updates on Huobi can have 12 significant digits. Currently, ccxws uses 8 digits.

let asks = tick.asks
      ? tick.asks.map(p => new Level2Point(p[0].toFixed(8), p[1].toFixed(2)))
      : [];
    let bids = tick.bids
      ? tick.bids.map(p => new Level2Point(p[0].toFixed(8), p[1].toFixed(2)))
      : [];