Image

Imagekriona wrote in Imagephp 😡annoyed

My dilemna today was that 393.9 did not equal 393.9.

I used var_dump on both variables, they both echoed float(393.9). I used var_export(), one spit out 393.9 and the other '393.9' (not the 's). I used floatval() and doubleval() on both, they still didn't equal each other. print_r() was no help. serialize() finally told me that one was 393.9 and the other was 393.89999999999992041921359486877918243408203125 (copied right out of my browser window). Moral of the story? Always use round(), even if the math you are doing is only to the first decimal place.