Commit 23cfb4d6 authored by ZhuChunYang's avatar ZhuChunYang

rmb字段保留4位小数

parent ef48a0f9
...@@ -80,7 +80,7 @@ class ExchangeBusiness ...@@ -80,7 +80,7 @@ class ExchangeBusiness
foreach ($quotation as $key => $item) { foreach ($quotation as $key => $item) {
$quotation[$key] = (float) sprintf("%0.4f", (double) $item); $quotation[$key] = (float) sprintf("%0.4f", (double) $item);
} }
$quotation['rmb'] = (float) sprintf("%0.2f", 6.6 * $quotation['last']); $quotation['rmb'] = (float) sprintf("%0.4f", 6.6 * $quotation['last']);
return $quotation; return $quotation;
} }
...@@ -138,7 +138,7 @@ class ExchangeBusiness ...@@ -138,7 +138,7 @@ class ExchangeBusiness
try { try {
$coinServer = CoinFactory::createCoin($row['name'], $row['id'], $row['sid']); $coinServer = CoinFactory::createCoin($row['name'], $row['id'], $row['sid']);
$rows[$key]['sid'] = ucfirst($rows[$key]['sid']); $rows[$key]['sid'] = ucfirst($rows[$key]['sid']);
$rows[$key]['rmb'] = $coinServer->getPrice(); $rows[$key]['rmb'] = number_format($coinServer->getPrice(),4);
$rows[$key]['last'] = $coinServer->getDollar(); $rows[$key]['last'] = $coinServer->getDollar();
$rows[$key]['low'] = $coinServer->getLow(); $rows[$key]['low'] = $coinServer->getLow();
$rows[$key]['high'] = $coinServer->getHigh(); $rows[$key]['high'] = $coinServer->getHigh();
......
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