In one point in my PHP script a simple compare doesn't seem to be working properly:
echo $newBookingAmountIn;
echo $unpaidAmount;
if ($newBookingAmountIn > $unpaidAmount)
echo "newBookingAmountIn > unpaidAmount";
OUTPUT IS:
28.57
28.57
newBookingAmountIn > unpaidAmount
I thought there might have been a problem with the variables casts. The $newBookingAmountIn is a string and the variable $unpaidAmount is a double so I did the following just to be sure that PHP wasn't having any trouble :
settype($newBookingAmountIn, "double");
settype($unpaidAmount, "double");
echo $newBookingAmountIn."<br>";
echo $unpaidAmount."<br>";;
echo gettype($newBookingAmountIn)."<br>";
echo gettype($unpaidAmount)."<br>";
if ($newBookingAmountIn > $unpaidAmount)
echo "newBookingAmountIn > unpaidAmount";
OUTPUT IS:
28.57
28.57
double
double
newBookingAmountIn > unpaidAmount
In each case the compare results TRUE saying that 28.57 is greater than 28.57.
Any ideas ????
Thanks.
George 🙁