Judging by your variable names you're passing a string into this function, but as the message says, number_format()
requires a double
.
You can force the issue by adding
$str = floatval($str);
as the first line of your function.
This assumes that your $str
variable contains something that can be coerced to a double
. If it doesn't you might see other errors.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…