Tugger the SLUGger!SLUG Mailing List Archives

Re: [coders] RubySIG Lesson Code


On 6/14/06, Benno <benjl@xxxxxxxxxxxxxxx> wrote:
>justin@dapper:~/$ ./round5.php 7.4
>5.4
>(WTF?  in php
>$remainder = $amount % 5;
>returns an int, not a float...)

I think you need:

$remainder = fmod($amount, 5);

yep, spot on. thanks for pointing that out.