Possible Duplicate:
PHP: show a number to 2 decimal places
How do I cast an integer, let’s say $i=50 to a float with two decimal values: $m=50.00? I have tried (float)$i but nothing happens.
EDIT:
I need to make $i == $m so that returns TRUE;
If you’re just using the regular equality operator (
==) instead of the type-safe equality operator (===) you shouldn’t have any problems.Comparing a double to an int with the same values:
If we would like to fix that, however, we just need to do: