Math functions 1. Can't get past it despite the code running OK


Hi there,

I've tried a few ways of coding the second part of this problem, all of which execute correctly, but none of them allow me to successfully submit and continue.

I get the error 'Oops, try again. Your second call to round() should print a floating point number with exactly 3 digits after the decimal.

Can anyone help?

Many Thanks


// Try rounding a floating point number to an integer
// and print it to the screen
$num = 1.68456;
$rounded = round($num);
print $rounded;
<?php {
print round(1.71254, 3);


Please post a link to the exercise so we can test and compare. Thanks.


Hi There. Thanks - here you go...


Not able to reproduce the error. Your code passes for me in FF.


Thanks a lot. After you confirmed the code was correct, I refreshed the original exercise and pasted my code into it. It was accepted. It must be because I deleted some of the comment lines when adding my code.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.