Commit 3c86636c authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/ticker' into 'master'

remove . See merge request !481
parents 60783e18 571ff4bc
...@@ -68,12 +68,12 @@ class MarketController extends BaseController ...@@ -68,12 +68,12 @@ class MarketController extends BaseController
if ('USDT' == strtoupper($base_currency)) { if ('USDT' == strtoupper($base_currency)) {
$currency_ticker = $exchange->getTicker($currency, 'USDT'); $currency_ticker = $exchange->getTicker($currency, 'USDT');
if (empty($currency_ticker)){ if (empty($currency_ticker)) {
$this->code = -1; $this->code = -1;
$this->msg = '此交易所暂不支持所选币种!'; $this->msg = '此交易所暂不支持所选币种!';
goto doEnd; goto doEnd;
} }
$this->data = rtrim(sprintf('%.6f',$currency_ticker['last']), '0'); $this->data = rtrim(sprintf('%.6f', $currency_ticker['last']), '0');
goto doEnd; goto doEnd;
} }
...@@ -85,6 +85,9 @@ class MarketController extends BaseController ...@@ -85,6 +85,9 @@ class MarketController extends BaseController
goto doEnd; goto doEnd;
} }
$this->data = rtrim(sprintf('%.6f', 1 / $currency_ticker['last']), '0'); $this->data = rtrim(sprintf('%.6f', 1 / $currency_ticker['last']), '0');
if ('.' == substr($this->data, -1)) {
$this->data = rtrim($this->data, '.');
}
goto doEnd; goto doEnd;
} }
...@@ -109,7 +112,7 @@ class MarketController extends BaseController ...@@ -109,7 +112,7 @@ class MarketController extends BaseController
'rmb' => (float)sprintf("%0.2f", $base_currency_ticker['last']), 'rmb' => (float)sprintf("%0.2f", $base_currency_ticker['last']),
]; ];
$this->data = rtrim(sprintf('%.6f',$currency_quotation['last'] / $base_currency_quotation['last']), '0'); $this->data = rtrim(sprintf('%.6f', $currency_quotation['last'] / $base_currency_quotation['last']), '0');
doEnd : doEnd :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment