From 4cfab278e85a5feb2aaac25faa737b9b73f3da98 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 30 Jun 2014 08:14:22 +0200 Subject: [PATCH] [FIX] +3 on table widths --- cronjobs/pplns_payout.php | 3 ++- cronjobs/pps_payout.php | 7 ++++--- cronjobs/proportional_payout.php | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cronjobs/pplns_payout.php b/cronjobs/pplns_payout.php index 40fc8f0d..dc81fa7a 100755 --- a/cronjobs/pplns_payout.php +++ b/cronjobs/pplns_payout.php @@ -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 diff --git a/cronjobs/pps_payout.php b/cronjobs/pps_payout.php index a2246109..deeeb095 100755 --- a/cronjobs/pps_payout.php +++ b/cronjobs/pps_payout.php @@ -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) { diff --git a/cronjobs/proportional_payout.php b/cronjobs/proportional_payout.php index 8870cd5f..95daf0ff 100755 --- a/cronjobs/proportional_payout.php +++ b/cronjobs/proportional_payout.php @@ -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