We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d2e68b4 + 02a82c0 commit c65ce90Copy full SHA for c65ce90
src/FloatCmp.php
@@ -13,6 +13,7 @@
13
use function floatval;
14
use function function_exists;
15
use function number_format;
16
+use function substr;
17
18
class FloatCmp
19
{
@@ -55,11 +56,13 @@ private static function strval(
55
56
float $value,
57
int $scale
58
): string {
- return number_format(
59
+ /** @var string $result */
60
+ $result = number_format(
61
$value,
- $scale,
62
+ ++$scale,
63
self::DECIMAL_SEPARATOR,
64
''
65
);
66
+ return substr($result, 0, -1);
67
}
68
0 commit comments