Skip to content

Commit

Permalink
Fixed failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Mar 26, 2022
1 parent 31ca7f4 commit e199d72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static function bool($variable): bool
* @param int $round
* @return float
*/
public static function float($value, int $round = 16): float
public static function float($value, int $round = 10): float
{
$cleaned = (string)\preg_replace('#[^\deE\-\.\,]#iu', '', (string)$value);
$cleaned = \str_replace(',', '.', $cleaned);
Expand Down
3 changes: 2 additions & 1 deletion tests/EnvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace JBZoo\PHPUnit;

use JBZoo\Utils\Env;
use JBZoo\Utils\Filter;

/**
* Class EnvTest
Expand Down Expand Up @@ -94,7 +95,7 @@ public function testInt(): void

public function testFloat(): void
{
$value = 1 / 3;
$value = Filter::float(1 / 3);

putenv("FOO= {$value} ");
isSame($value, Env::float('FOO'));
Expand Down

0 comments on commit e199d72

Please sign in to comment.