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 f6c70b7 commit 31ca7f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
},

"config" : {
"optimize-autoloader" : true
"optimize-autoloader" : true,
"allow-plugins": {
"composer/package-versions-deprecated": false
}
},

"extra" : {
Expand Down
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 = 10): float
public static function float($value, int $round = 16): float
{
$cleaned = (string)\preg_replace('#[^\deE\-\.\,]#iu', '', (string)$value);
$cleaned = \str_replace(',', '.', $cleaned);
Expand Down
2 changes: 1 addition & 1 deletion tests/EnvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testInt(): void

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

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

0 comments on commit 31ca7f4

Please sign in to comment.