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

Functions, Part I Forum

View Course » View Exercise

569 points
B011e5a873a8d9a7da5a3e4d88fd33ee?s=140&d=retro
Submitted by
Eli
over 4 years ago

Why does it say that I need to have 3 digits after the decimal, when I do?

This is my code:

<?php
$round = round(MPI);
print $round;
?>
<?php
$rounddecimal = round(M
PI, 3);
print $rounddecimal;
?>

There's nothing other than that. Any help is appreciated.


1 vote

permalink

You are missing the underscore in the constant M_PI.

1912 points
52565eeb80ff337232001e7d_158831513
Submitted by
brennanpringle_4f151ba89c99ab0001018
about 4 years ago


1 vote

permalink

<?php
$round = round(4.469);
print $round; // prints4

?>
</p>
<p>
<?php
$round_decimal = round(M_PI, 3);

print $round_decimal; // prints 3.1416
?>


this code is working... u can try this..

493 points
52135b0180ff33b32a002f97_626794803
Submitted by
kichhu minni
about 4 years ago

1 Comment

482d03b865bfc035a8416baf8135e9a1?s=140&d=retro Christopher Leong over 3 years ago

ty