I have a double $measure and for every beat in my 'song' I add another double. When $measure increments by a whole integer, I want to print this new measure out.
It seems like PHP wants to round these values to make the double look nice for me. Here is an example printout I get:
Measure: 17 Floor: 16 Rounded: 16
from the code:
echo "Measure: " . floatval($measure) . "Floor: " . floor($measure) . " Rounded: " . $roundMeasure . " ";
It seems as though $measure actually contains 16.99999999 or some similar value. Is there any way to read it's actual contents? And better yet, is there any way to use PHP's rounding system so I can just grab the 17? Thanks.