We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10a0739 commit 3d6436eCopy full SHA for 3d6436e
1 file changed
system/Helpers/number_helper.php
@@ -82,8 +82,9 @@ function number_to_amount($num, int $precision = 0, ?string $locale = null)
82
// Strip any formatting & ensure numeric input
83
try {
84
// @phpstan-ignore-next-line
85
- $num = 0 + str_replace(',', '', $num);
+ $num = 0 + str_replace(',', '', (string) $num);
86
} catch (ErrorException) {
87
+ // Catch "Warning: A non-numeric value encountered"
88
return false;
89
}
90
0 commit comments