|
@@ -248,11 +248,22 @@ class chctl
|
|
|
$lprofit = ($out_price - $l->price()) * $lRatio;
|
|
|
$rprofit = ($out_price - $r->price()) * $rRatio;
|
|
|
|
|
|
+ $lprofit = ncPriceFormat($lprofit);
|
|
|
+ $rprofit = ncPriceFormat($rprofit);
|
|
|
+ $lRatio = ncPriceFormat($lRatio);
|
|
|
+ $rRatio = ncPriceFormat($rRatio);
|
|
|
+
|
|
|
if($lprofit > $rprofit) return -1;
|
|
|
elseif($lprofit < $rprofit) return 1;
|
|
|
+ elseif($lprofit == 0)
|
|
|
+ {
|
|
|
+ if($lCount > $rCount) return 1;
|
|
|
+ elseif($lCount < $rCount) return -1;
|
|
|
+ else return 0;
|
|
|
+ }
|
|
|
elseif($lRatio > $rRatio) return -1;
|
|
|
elseif($lRatio < $rRatio) return 1;
|
|
|
- return 0;
|
|
|
+ else return 0;
|
|
|
};
|
|
|
|
|
|
usort($feeds, $desc_profit);
|