From 4f201537b2058f7fed12752a0bffba1527a6575f Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Wed, 7 May 2014 05:56:29 +0100 Subject: [PATCH] Show the modifier in the result string --- post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 8b75a112..8e2a5a0f 100644 --- a/post.php +++ b/post.php @@ -533,7 +533,8 @@ if (isset($_POST['delete'])) { } // Prepend the result to the post body - $post['body'] = 'Rolled ' . implode(', ', $dicerolls) . ' = ' . $dicesum . "\r\n" . $post['body']; + $modifier = ($diceZ != 0) ? ((($diceZ < 0) ? ' - ' : ' + ') . abs($diceZ)) : ''; + $post['body'] = 'Rolled ' . implode(', ', $dicerolls) . $modifier . ' = ' . $dicesum . "\r\n" . $post['body']; } }