Browse Source

php - payout help number formatting

master
kanoi 9 years ago
parent
commit
3ae73463fe
  1. 12
      pool/base.php
  2. 8
      pool/page_payout.php

12
pool/base.php

@ -121,15 +121,27 @@ function howmanyhrs($tot, $days = false, $dh = false)
if ($dh == true)
{
if ($min >= 30)
{
$hr++;
if ($hr == 24)
{
$days++;
$hr = 0;
}
}
$ds = '';
if ($dy != 1)
$ds = 's';
if ($hr == 0)
$des = "${dy}day$ds";
else
{
$hs = '';
if ($hr != 1)
$hs = 's';
$des = "${dy}day$ds ${hr}hr$hs";
}
}
else
$des = $dy.'d '.$hr.'hr '.$min.'m '.$sec.'s';
}

8
pool/page_payout.php

@ -15,14 +15,14 @@ function dopayout($data, $user)
$nd = $data['info']['currndiff'];
$nv = number_format($nd, 1);
$nvx = '<b>'.number_format($N*$nd, 1).'</b>';
$phr = $data['info']['p_hashrate24hr'];
$pd = $data['info']['p_hashrate24hr'];
$hr = 'is <b>?</b>';
$hrt = '<b>?</b>';
if ($phr != '?' && $phr != '' && $phr > 0)
if ($pd != '?' && $pd != '' && $pd > 0)
{
$hr = 'for the last day is <b>'.dsprate($phr).'</b>';
$hr = 'for the last day is roughly <b>'.siprefmt($pd,2).'Hs</b>';
if ($nd > 0)
$hrt = '<b>'.howmanyhrs($nd / ($phr / pow(2,32)), true, true).'</b>';
$hrt = '<b>'.howmanyhrs($nd * $N / ($pd / pow(2,32)), true, true).'</b>';
}
$pg = "<h1>Payouts</h1>

Loading…
Cancel
Save