From 14c77ea7db6a0a1a5151b05365f2683ce99f7dcf Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 7 Jul 2016 11:58:14 +0200 Subject: [PATCH] [FIX] Catch edgecase PHP warning --- templates/bluemoon/dashboard/blocks/default.tpl | 4 ++-- templates/bootstrap/dashboard/blocks/default.tpl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/bluemoon/dashboard/blocks/default.tpl b/templates/bluemoon/dashboard/blocks/default.tpl index 2c39f49b..52fa1c8f 100644 --- a/templates/bluemoon/dashboard/blocks/default.tpl +++ b/templates/bluemoon/dashboard/blocks/default.tpl @@ -34,7 +34,7 @@ {$BLOCKSFOUND[block].estshares|number_format} {$BLOCKSFOUND[block].shares|number_format} - {math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares|default:"0" estshares=$BLOCKSFOUND[block].estshares} + {if estshares > 0 }{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares|default:"0" estshares=$BLOCKSFOUND[block].estshares}{else}{assign var=percentage value="0"}{/if} {$percentage|number_format:"2"} @@ -51,4 +51,4 @@ {/if} -{/if} \ No newline at end of file +{/if} diff --git a/templates/bootstrap/dashboard/blocks/default.tpl b/templates/bootstrap/dashboard/blocks/default.tpl index d947f537..efa4f077 100644 --- a/templates/bootstrap/dashboard/blocks/default.tpl +++ b/templates/bootstrap/dashboard/blocks/default.tpl @@ -29,7 +29,7 @@ {$BLOCKSFOUND[block].estshares|number_format} {$BLOCKSFOUND[block].shares|number_format} - {math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares|default:"0" estshares=$BLOCKSFOUND[block].estshares} + {if estshares > 0 }{math assign="percentage" equation="shares / estshares * 100" shares=$BLOCKSFOUND[block].shares|default:"0" estshares=$BLOCKSFOUND[block].estshares}{else}{assign var=percentage value="0"}{/if} {$percentage|number_format:"2"} @@ -46,4 +46,4 @@ {/if} -{/if} \ No newline at end of file +{/if}