How to make auto convert a decimal data type into number not a string in php?
I changed data field into decimal(4,2) from double. I have many checks like
if ($row->field)
And $row->field === 0.00. When it was double it's ok. But when I get decimal in php it's get string type and '0.00' it's TRUE.
"Add (float) before $row->field" are not my way, because I change many field and too many places where I use it.
I want find a better way, than change too many lines of code. Maybe some extensions or something else.
if($row->field)is always better coded asif($row->field != 0)orif($row->field > 0)if those are what is meant.