Repository: phpbench/phpbench (php)

Issue:
`percent_diff()` expression formatting
It would be nice if the `percent_diff()` would also add thousand separators like everything else does, because `13026.5%` is hard to read.

Pull request description:
Fix formatting of number with zero decimal precision
Fixes #1008

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a46f73c6..dc67653f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@ master
 
 Improvements:
 
-- Remove dependency on `webmozaty/path` (copied the class into PHPBench)
+- Remove dependency on `webmozart/path` (copied the class into PHPBench)
 - Update PHPStan to 1.0 and fix new errors #1006
 - Use `webmozart/glob` instead of `glob` for benchmark paths and config
   include paths #1005
@@ -14,6 +14,7 @@ Improvements:
 Bug fixes:
 
 - Fix bad exception call #1002 @TRowbotham
+- Fix comma formatting of numbers with no zero decimal precision #1008
 
 1.2.6
 -----
diff --git a/lib/Util/NumberFormat.php b/lib/Util/NumberFormat.php
index ed8c0e9e..ea4b6bd5 100644
--- a/lib/Util/NumberFormat.php
+++ b/lib/Util/NumberFormat.php
@@ -18,7 +18,7 @@ class NumberFormat
             $formated = rtrim($formated, '0');
 
             if (substr($formated, -1) === '.') {
-                return (string)$number;
+                return (string)number_format($number);
             }
         }
 


Test patch:
diff --git a/tests/Unit/Util/NumberFormatTest.php b/tests/Unit/Util/NumberFormatTest.php
index 1f70dde1..c93e0342 100644
--- a/tests/Unit/Util/NumberFormatTest.php
+++ b/tests/Unit/Util/NumberFormatTest.php
@@ -44,5 +44,7 @@ class NumberFormatTest extends TestCase
         yield [10.12, 3, false, '10.120'];
 
         yield [10.000, 3, false, '10.000'];
+
+        yield [1000, 3, true, '1,000'];
     }
 }