Skip to content

Commit

Permalink
Update src/Toolkit/Str.php
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Bestle <lukas@getkirby.com>
  • Loading branch information
distantnative and lukasbestle authored Aug 26, 2023
1 parent ad6bc96 commit 581d10d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Toolkit/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ public static function float(
$decimal = strrchr($value, '.');
$decimal = match ($decimal) {
false => 0,
default => strlen(substr($decimal, 1))
default => strlen($decimal) - 1
};

return number_format((float)$value, $decimal, '.', '');
Expand Down

0 comments on commit 581d10d

Please sign in to comment.