This question has already been answered:
var_dump(floatval($this->amount)); \\float(18000) var_dump($sum); \\float(18000) var_dump(floatval($this->amount)-$sum); die; \\float(-3.6379788070917E-12) What is wrong with subtraction?
This question has already been answered:
var_dump(floatval($this->amount)); \\float(18000) var_dump($sum); \\float(18000) var_dump(floatval($this->amount)-$sum); die; \\float(-3.6379788070917E-12) What is wrong with subtraction?
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
floatval() cannot be used with objects in this case an error of the E_NOTICE level will occur and the function will return 1 .
Maybe this is the problem.
Source: https://ru.stackoverflow.com/questions/634298/
All Articles