From 19a0eeb8a1f0281975cf11ca6fcbb7c497befa9c Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 1 Jul 2013 18:27:41 +0200 Subject: [PATCH] Adding colorized percentage As requested by @obigal this will add colorized percentage: * Above 100% it's red * Below or even 100% it's green Fixes #321 --- public/templates/mmcFE/statistics/blocks/default.tpl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/templates/mmcFE/statistics/blocks/default.tpl b/public/templates/mmcFE/statistics/blocks/default.tpl index 587f7f27..539897c7 100644 --- a/public/templates/mmcFE/statistics/blocks/default.tpl +++ b/public/templates/mmcFE/statistics/blocks/default.tpl @@ -61,9 +61,15 @@ target and network difficulty and assuming a zero variance scenario. {$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"} {$BLOCKSFOUND[block].difficulty|number_format:"2"} {$BLOCKSFOUND[block].amount|number_format:"2"} - {(pow(2,32 - $GLOBAL.config.targetdiff) * $BLOCKSFOUND[block].difficulty)|number_format} + + {math assign="estshares" equation="(pow(2,32 - targetdiff) * blockdiff)" targetdiff=$GLOBAL.config.targetdiff blockdiff=$BLOCKSFOUND[block].difficulty} + {$estshares} + {$BLOCKSFOUND[block].shares|number_format} - {($BLOCKSFOUND[block].shares / (pow(2,32 - $GLOBAL.config.targetdiff) * $BLOCKSFOUND[block].difficulty) * 100)|number_format:"2"} + + {math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares estshares=$estshares} + {$percentage} + {/section}