Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

TypeError: "Unsupported operand types: string * float"

I have the Error: TypeError Unsupported operand types: string * float
The Error is in this Line:
$pricere1 = $db_price * $validate->getIntervalFactor($runtime) * $mainrabatt_script;
I tried to find the Error but nothing worked for me :/

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So you are multiplying string with float. One of your variable is holding string value.
You can var_dump() to see which variable hold the string data, and change the value to float. Otherwise you can cast those variable to float.

$pricere1 = (float)$db_price * (float)$validate->getIntervalFactor($runtime) * (float)$mainrabatt_script;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading