This forum is now read-only. Please use our new forums at discuss.codecademy.com.

# Why won't this pass?

Here's my code

``````<?php
// Try rounding a floating point number to 3 decimal places
// and print it to the screen
\$round = round(36.549783);
print \$round;

\$round_decimal = round(36.89737374, 3);
print \$round_decimal;

?>
``````

I get an error message saying "Your first call to round() should print an integer." even though it does.

Any ideas?

What they are saying here is your first call to round function (line 6) is not displaying an integer (a number WITHOUT a decimal or fractional component). Below is the code I wrote to get the correct answer.

1
2
3 <?php
4 // Try rounding a floating point number to an integer
5 // and print it to the screen
6 \$round = round(MPI);
7 print \$round;
8 ?>
9
10
11 <?php
12 // Try rounding a floating point number to 3 decimal places
13 // and print it to the screen
14 \$round = round(M
PI,3);
15 print \$round;
16 ?>
17
18

Kiernan Maguire about 4 years ago

i did it but it did not work

jonathan lewis about 4 years ago

Your Pi needs a _ between M and P

ohh ok, thanks
the website screwed up my code then cause i did pass it somehow o.O

Thank you for your help!!

<?php
// Try rounding a floating point number to 3 decimal places
// and print it to the screen
\$round = round(36.549783);
print \$round;

`\$round_decimal` = round(36.89737374, 3);
print \$round_decimal;

?>

\$rounddecimal!!!

i have found this one to be solution for you.

##### 1 Comment

James Stroehmann about 4 years ago

Works, but wow that does not make sense.