Commit 836c9ded authored by shajiaiming's avatar shajiaiming

小数点后变4位

parent 5b4873cc
...@@ -90,42 +90,42 @@ class ExchangeBusiness ...@@ -90,42 +90,42 @@ class ExchangeBusiness
if(in_array(strtoupper($tag),['GM', 'BSTC'])){ if(in_array(strtoupper($tag),['GM', 'BSTC'])){
$exchange = ExchangeFactory::createExchange("Token7"); $exchange = ExchangeFactory::createExchange("Token7");
$quotation = $exchange->getTicker($tag, 'HA'); $quotation = $exchange->getTicker($tag, 'HA');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
return $quotation; return $quotation;
} }
if(in_array(strtoupper($tag),['BECC'])){ if(in_array(strtoupper($tag),['BECC'])){
$exchange = ExchangeFactory::createExchange("S"); $exchange = ExchangeFactory::createExchange("S");
$quotation = $exchange->getTicker($tag, 'ST'); $quotation = $exchange->getTicker($tag, 'ST');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
return $quotation; return $quotation;
} }
if(in_array(strtoupper($tag),['GHP'])){ if(in_array(strtoupper($tag),['GHP'])){
$exchange = ExchangeFactory::createExchange("Zg"); $exchange = ExchangeFactory::createExchange("Zg");
$quotation = $exchange->getTicker($tag, 'CNZ'); $quotation = $exchange->getTicker($tag, 'CNZ');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
return $quotation; return $quotation;
} }
if(in_array(strtoupper($tag),['SFT'])){ if(in_array(strtoupper($tag),['SFT'])){
$exchange = ExchangeFactory::createExchange("Zhaobi"); $exchange = ExchangeFactory::createExchange("Zhaobi");
$quotation = $exchange->getTicker($tag, 'CNY'); $quotation = $exchange->getTicker($tag, 'CNY');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
return $quotation; return $quotation;
} }
if(in_array(strtoupper($tag),['CTG'])){ if(in_array(strtoupper($tag),['CTG'])){
$exchange = ExchangeFactory::createExchange("Gdpro"); $exchange = ExchangeFactory::createExchange("Gdpro");
$quotation = $exchange->getTicker($tag, 'CNY'); $quotation = $exchange->getTicker($tag, 'CNY');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
return $quotation; return $quotation;
} }
if(in_array(strtoupper($tag),['USDT'])){ if(in_array(strtoupper($tag),['USDT'])){
$exchange = ExchangeFactory::createExchange("Go"); $exchange = ExchangeFactory::createExchange("Go");
$quotation = $exchange->getTicker('CNY', 'USD'); $quotation = $exchange->getTicker('CNY', 'USD');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last']);
return $quotation; return $quotation;
} }
...@@ -180,7 +180,7 @@ class ExchangeBusiness ...@@ -180,7 +180,7 @@ class ExchangeBusiness
$rate = $exchange->getTicker("BTY", "USDT"); $rate = $exchange->getTicker("BTY", "USDT");
$rate = (float)$rate['rmb'] / $rate['last']; $rate = (float)$rate['rmb'] / $rate['last'];
} }
$quotation['rmb'] = (float)sprintf("%0.2f", $rate * $quotation['last']); $quotation['rmb'] = (float)sprintf("%0.4f", $rate * $quotation['last']);
return $quotation; return $quotation;
} }
......
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