I have a function which returns a value of 1725.00 using the number_format(value,2). So, now when I convert it to float, it gives 1, same for int,intValue,floatValue. Even I tried multiplying with 100 to get the int value, but it gives an error of A non well formed numerical value. Does anyone know what is wrong here?
$balance = (float) currentBalance($user_id); // currentBalance gives a value of 1725, but (float) gives makes the value 1.
print_r($balance); die; //gives 1.
I'm using PHP 7.0+ and Laravel 5.8.