@@ -329,7 +329,7 @@ Ethplorer = {
329
329
var pf = parseFloat ( totalSupply . replace ( / \, / g, '' ) . split ( ' ' ) [ 0 ] ) ;
330
330
if ( pf ) {
331
331
pf = Ethplorer . Utils . round ( pf * oToken . price . rate , 2 ) ;
332
- totalSupply = totalSupply + '<br><span class="total-supply-usd">$ ' + Ethplorer . Utils . formatNum ( pf , true , 2 , true ) + '</span>' ;
332
+ totalSupply = totalSupply + '<br><span class="total-supply-usd">$ ' + Ethplorer . Utils . formatNum ( pf , true , 2 , true ) + '</span>' ;
333
333
$ ( '#transaction-token-totalSupply' ) . html ( totalSupply ) ;
334
334
}
335
335
}
@@ -363,7 +363,7 @@ Ethplorer = {
363
363
}
364
364
var value = oOperation . value ;
365
365
if ( valFloat && oToken . price && oToken . price . rate ) {
366
- value = value + '<br><span class="tx-value-price">$ ' + Ethplorer . Utils . formatNum ( oToken . price . rate * valFloat , true , 2 , true , true ) + '</span>' ;
366
+ value = value + '<br><span class="tx-value-price">$ ' + Ethplorer . Utils . formatNum ( oToken . price . rate * valFloat , true , 2 , true , true ) + '</span>' ;
367
367
value += getHistDiffPriceString ( op . usdPrice , oToken . price . rate ) ;
368
368
}
369
369
$ ( '#transfer-operation-value' ) . html ( value ) ;
@@ -510,7 +510,7 @@ Ethplorer = {
510
510
var pf = parseFloat ( totalSupply . replace ( / \, / g, '' ) . split ( ' ' ) [ 0 ] ) ;
511
511
if ( pf ) {
512
512
pf = Ethplorer . Utils . round ( pf * oToken . price . rate , 2 ) ;
513
- totalSupply = totalSupply + '<br><span class="total-supply-usd">$ ' + Ethplorer . Utils . formatNum ( pf , true , 2 , true ) + '</span>' ;
513
+ totalSupply = totalSupply + '<br><span class="total-supply-usd">$ ' + Ethplorer . Utils . formatNum ( pf , true , 2 , true ) + '</span>' ;
514
514
$ ( '#transaction-token-totalSupply' ) . html ( totalSupply ) ;
515
515
}
516
516
}
@@ -609,7 +609,7 @@ Ethplorer = {
609
609
if ( oOperation . value ) {
610
610
var value = oOperation . value ;
611
611
if ( valFloat && oToken . price && oToken . price . rate ) {
612
- value = value + '<br><span class="tx-value-price">$ ' + Ethplorer . Utils . formatNum ( oToken . price . rate * valFloat , true , 2 , true , true ) + '</span>' ;
612
+ value = value + '<br><span class="tx-value-price">$ ' + Ethplorer . Utils . formatNum ( oToken . price . rate * valFloat , true , 2 , true , true ) + '</span>' ;
613
613
value += getHistDiffPriceString ( oOperation . usdPrice , oToken . price . rate ) ;
614
614
}
615
615
$ ( '#transfer-operation-value' ) . html ( value ) ;
@@ -853,7 +853,7 @@ Ethplorer = {
853
853
var pf = parseFloat ( totalSupply . replace ( / \, / g, '' ) . split ( ' ' ) [ 0 ] ) ;
854
854
if ( pf ) {
855
855
pf = Ethplorer . Utils . round ( pf * oToken . price . rate , 2 ) ;
856
- totalSupply = totalSupply + '<br><span class="total-supply-usd">$ ' + Ethplorer . Utils . formatNum ( pf , true , 2 , true ) + '</span>' ;
856
+ totalSupply = totalSupply + '<br><span class="total-supply-usd">$ ' + Ethplorer . Utils . formatNum ( pf , true , 2 , true ) + '</span>' ;
857
857
$ ( '#address-token-totalSupply' ) . html ( totalSupply ) ;
858
858
}
859
859
}
@@ -913,7 +913,7 @@ Ethplorer = {
913
913
if ( balances [ k ] . price ) {
914
914
var rate = oToken . price ;
915
915
var price = balances [ k ] . balanceUSD ;
916
- value += ( '<br><div class="balances-price" title="$' + price + '">$ ' + Ethplorer . Utils . formatNum ( price , true , 2 , true ) + ' ' ) ;
916
+ value += ( '<br><div class="balances-price" title="$' + price + '">$ ' + Ethplorer . Utils . formatNum ( price , true , 2 , true ) + ' ' ) ;
917
917
if ( rate . diff ) {
918
918
var cls = getDiffClass ( rate . diff ) ;
919
919
var hint = 'Updated at ' + Ethplorer . Utils . ts2date ( rate . ts , true ) ;
@@ -946,7 +946,7 @@ Ethplorer = {
946
946
$ ( '#address-token-balances table' ) . append ( row ) ;
947
947
}
948
948
if ( totalPrice ) {
949
- var value = '~ $ ' + Ethplorer . Utils . formatNum ( totalPrice , true , 2 , true , true ) ;
949
+ var value = '~ $ ' + Ethplorer . Utils . formatNum ( totalPrice , true , 2 , true , true ) ;
950
950
if ( totalDiff ) {
951
951
var cls = getDiffClass ( totalDiff ) ;
952
952
if ( totalDiff > 0 ) {
@@ -1130,7 +1130,7 @@ Ethplorer = {
1130
1130
value = ( tx . type && ( 'burn' === tx . type ) ) ? '-' + value + '<br>🔥 Burn' : value + '<br>⚒ Issuance' ;
1131
1131
}
1132
1132
var pf = parseFloat ( value . replace ( / \, / g, '' ) . split ( ' ' ) [ 0 ] ) ;
1133
- var usdPrice = '' ;
1133
+ var usdPrice = '<br> ' ;
1134
1134
if ( pf ) {
1135
1135
1136
1136
// Fill the tx.usdPrice if tx age less 10 minutes, because of delay price update scripts
@@ -1140,22 +1140,25 @@ Ethplorer = {
1140
1140
1141
1141
if ( txToken . price && txToken . price . rate ) {
1142
1142
var usdval = Ethplorer . Utils . formatNum ( Math . abs ( Ethplorer . Utils . round ( pf * txToken . price . rate , 2 ) ) , true , 2 , true ) ;
1143
- value = value + '<br><span class="transfer-usd" title="now">$ ' + usdval +
1143
+ value = value + '<br><span class="transfer-usd" title="now">$ ' + usdval +
1144
1144
getHistDiffPriceString ( tx . usdPrice , txToken . price . rate ) + '</span>' ;
1145
1145
}
1146
1146
if ( tx . usdPrice && Ethplorer . showHistoricalPrice ) {
1147
1147
var hint = 'estimated at tx date' ;
1148
1148
var totalHistoryPrice = Ethplorer . Utils . formatNum ( Math . abs ( Ethplorer . Utils . round ( pf * tx . usdPrice , 2 ) ) , true , 2 , true ) ;
1149
1149
var historyPrice = Ethplorer . Utils . formatNum ( Math . abs ( Ethplorer . Utils . round ( tx . usdPrice , 2 ) ) , true , 2 , true ) ;
1150
- usdPrice = '<br><span class="historical-price" title="' + hint + '">~$ '
1150
+ if ( historyPrice === '0.00' ) {
1151
+ historyPrice = '>0.00' ;
1152
+ }
1153
+ usdPrice = '<span class="historical-price" title="' + hint + '">~$ '
1151
1154
+ totalHistoryPrice + '<span class="mrgnl-10">@ ' + historyPrice + '</span></span>'
1152
1155
}
1153
1156
}
1154
1157
value += usdPrice ;
1155
1158
divData . html (
1156
1159
'<span class="show_small">Date: ' + date + '<br></span>' +
1157
1160
( ! data . token ? ( '<span class="address-token-inline">Token: ' + token + '<br></span>' ) : '' ) +
1158
- '<span class="show_small ' + rowClass + '">Value: ' + value + '<br>< /span>' +
1161
+ '<span class="show_small ' + rowClass + '">Value: ' + value + '</span>' +
1159
1162
'Tx: ' + Ethplorer . Utils . getEthplorerLink ( tx . transactionHash ) + '<br>' +
1160
1163
( from ? ( 'From: ' + from + '<br>To: ' + to ) : ( 'Address: ' + _address ) )
1161
1164
) ;
@@ -1240,7 +1243,7 @@ Ethplorer = {
1240
1243
if ( pf ) {
1241
1244
pf = Ethplorer . Utils . round ( pf * oToken . price . rate , 2 ) ;
1242
1245
var usdval = Ethplorer . Utils . formatNum ( Math . abs ( pf ) , true , 2 , true ) ;
1243
- value = value + '<br><span class="transfer-usd">$ ' + usdval + '</span>' ;
1246
+ value = value + '<br><span class="transfer-usd">$ ' + usdval + '</span>' ;
1244
1247
}
1245
1248
}
1246
1249
tdQty . html ( value ) ;
@@ -1289,7 +1292,7 @@ Ethplorer = {
1289
1292
if ( pf ) {
1290
1293
pf = Ethplorer . Utils . round ( pf * oToken . price . rate , 2 ) ;
1291
1294
var usdval = Ethplorer . Utils . formatNum ( Math . abs ( pf ) , true , 2 , true ) ;
1292
- balance = balance + '<br><span class="transfer-usd">$ ' + usdval + '</span>' ;
1295
+ balance = balance + '<br><span class="transfer-usd">$ ' + usdval + '</span>' ;
1293
1296
}
1294
1297
}
1295
1298
@@ -1639,9 +1642,10 @@ Ethplorer = {
1639
1642
case 'price' :
1640
1643
if ( value && value . rate ) {
1641
1644
var rate = value ;
1642
- var hint = '$' + rate . rate + ' : Updated at ' + Ethplorer . Utils . ts2date ( rate . ts , true ) ;
1645
+ var hint = 'Updated at ' + Ethplorer . Utils . ts2date ( rate . ts , true ) ;
1646
+ var price = rate . rate < 0.01 ? rate . rate : Ethplorer . Utils . formatNum ( rate . rate , true , 2 , true ) ;
1643
1647
1644
- value = '<span title="' + hint + '">$ ' + Ethplorer . Utils . formatNum ( rate . rate , true , 2 , true ) + '</span><br>' ;
1648
+ value = '<span title="' + hint + '">$ ' + price + '</span><br>' ;
1645
1649
1646
1650
value = value + '<span class="diff-span">24h<span class="' + getDiffClass ( rate . diff ) + '">'
1647
1651
+ getDiffString ( rate . diff ) + '</span></span>'
@@ -1672,7 +1676,7 @@ Ethplorer = {
1672
1676
var cls = change > 0 ? 'diff-up' : 'diff-down' ;
1673
1677
var diff = "" ;
1674
1678
// var diff = change ? (' <span class="' + cls + '">(' + Ethplorer.Utils.round(change, 2) + '%)</span>') : '';
1675
- res = res + '<br /><span class="transfer-usd">$ ' + price + diff + '</span>' ;
1679
+ res = res + '<br /><span class="transfer-usd">$ ' + price + diff + '</span>' ;
1676
1680
}
1677
1681
}
1678
1682
value = res ;
@@ -2295,10 +2299,10 @@ function getHistUsdPriceString(histPrice, valFloat){
2295
2299
var usdPrice = '' ;
2296
2300
if ( histPrice && Ethplorer . showHistoricalPrice && valFloat ) {
2297
2301
var hint = 'estimated at tx date' ;
2298
- var historyPrice = Ethplorer . Utils . formatNum ( histPrice , true , 2 , true , true ) ;
2302
+ // var historyPrice = Ethplorer.Utils.formatNum(histPrice, true, 2, true, true);
2299
2303
var totalHistoryPrice = Ethplorer . Utils . formatNum ( histPrice * valFloat , true , 2 , true , true ) ;
2300
2304
2301
- usdPrice = '<span title="' + hint + '">~$ ' + totalHistoryPrice + '<span class="mrgnl-10">@ ' + historyPrice + '</span></span>'
2305
+ usdPrice = '<span title="' + hint + '">~$ ' + totalHistoryPrice + '<span class="mrgnl-10">@ ' + histPrice + '</span></span>'
2302
2306
}
2303
2307
return usdPrice ;
2304
2308
}
0 commit comments