JSFiddle - React, Tailwind, and code Playground

by Viet27th

JavaScript

then(function(e){return f(e[0])})}function d(t,o,i){var a,s=t.basicPrice,l=t.matchPrice,c=t.highestPrice,f=t.lowestPrice,p=(t.floorPrice,t.accumulatedVal),d=t.accumulatedVol,h=t.code,g=u(o);a=p>=1?parseFloat((p/d*1e5).toFixed(1)):NaN;var m=l-s,v=m/s*100,y=e.formatDate(new Date),b=NaN,k=NaN;t.floorCode===x.HNX&&(b=t.totalBidQtty-t.accumulatedVol,k=t.totalOfferQtty-t.accumulatedVol);var w=n(r("#widget-stock").text());return w({displayMode:i.toLowerCase(),symbol:h,matchPrice:e.formatValue(l),priceDelta:e.formatValue(m),priceDeltaPercent:e.formatValue(v)+"%",accVolume:e.formatQuantity(10*d),matchPriceColorClass:e.getStockPriceColor(l,t),highestPrice:e.formatValue(c),highestPriceColorClass:e.getStockPriceColor(c,t),averagePrice:e.formatValue(a),averagePriceColorClass:e.getStockPriceColor(a,t),lowestPrice:e.formatValue(f),lowestPriceColorClass:e.getStockPriceColor(f,t),buyingSurplus:e.formatQuantity(10*b),sellingSurplus:e.formatQuantity(10*k),marketStatus:g,renderTime:y})}