[FIX] +3 on table widths

This commit is contained in:
Sebastian Grewe 2014-06-30 08:14:22 +02:00
parent 4f8e9c505f
commit 4cfab278e8
3 changed files with 8 additions and 5 deletions

View File

@ -40,6 +40,7 @@ if (empty($aAllBlocks)) {
// Fetch precision
$precision = $setting->getValue('system_coin_precision', 12);
$table_precision = $setting->getValue('system_coin_precision', 12) + 3;
$log->logDebug('Starting PPLNS payout process');
$count = 0;
@ -184,7 +185,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
}
// Table header for account shares
$strLogMask = "| %5.5s | %-15.15s | %15.15s | %15.15s | %12.12s | %15.15s | %15.15s | %15.15s | %15.15s |";
$strLogMask = "| %5.5s | %-15.15s | %15.15s | %15.15s | %12.12s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s |";
$log->logInfo(sprintf($strLogMask, 'ID', 'Username', 'Valid', 'Invalid', 'Percentage', 'Payout', 'Donation', 'Fee', 'Bonus'));
// Loop through all accounts that have found shares for this round

View File

@ -90,13 +90,14 @@ $log->logInfo("\tQuery Completed...");
if (!empty($aAccountShares)) {
// Runtime information for this payout
$precision = $setting->getValue('system_coin_precision', 12);
$table_precision = $setting->getValue('system_coin_precision', 12) + 3;
$log->logInfo('Runtime information for this payout');
$strLogMask = "| %-15.15s | %15.15s | %15.15s | %15.15s | %3.3s |";
$strLogMask = "| %-15.15s | %15.15s | %15.15s | %${table_precision}.${table_precision}s | %3.3s |";
$log->logInfo(sprintf($strLogMask, 'PPS reward type', 'Reward Base', 'Difficulty', 'PPS Value', 'Precision'));
$log->logInfo(sprintf($strLogMask, $strRewardType, $pps_reward, $dDifficulty, $pps_value, $precision));
$log->logInfo('Per-user payout information');
$strLogMask = "| %8.8s | %25.25s | %15.15s | %15.15s | %18.18s | %18.18s | %18.18s |";
$log->logInfo(sprintf($strLogMask, 'User ID', 'Username', 'Invalid', 'Valid', ' * PPS Value', ' = Payout', 'Donation', 'Fee'));
$strLogMask = "| %8.8s | %25.25s | %15.15s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s |";
$log->logInfo(sprintf($strLogMask, 'User ID', 'Username', 'Invalid', 'Valid', '* PPS Value', ' = Payout', 'Donation', 'Fee'));
}
foreach ($aAccountShares as $aData) {

View File

@ -40,10 +40,11 @@ if (empty($aAllBlocks)) {
// Fetch precision
$precision = $setting->getValue('system_coin_precision', 12);
$table_precision = $setting->getValue('system_coin_precision', 12) + 3;
$count = 0;
// Table header for account shares
$strLogMask = "| %10.10s | %-5.5s | %15.15s | %15.15s | %12.12s | %12.12s | %15.15s | %15.15s | %15.15s | %15.15s |";
$strLogMask = "| %10.10s | %-5.5s | %15.15s | %15.15s | %12.12s | %12.12s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s | %${table_precision}.${table_precision}s |";
$log->logInfo(sprintf($strLogMask, 'Block', 'ID', 'Username', 'Valid', 'Invalid', 'Percentage', 'Payout', 'Donation', 'Fee', 'Bonus'));
foreach ($aAllBlocks as $iIndex => $aBlock) {
// If we have unaccounted blocks without share_ids, they might not have been inserted yet