This forum is now read-only. Please use our new forums! Go to forums
Why doesn't this pass
What is wrong with my code
Answer 5180b5fad427697d3a00104e
6 votes
Hope That Helps
<?php
// Try rounding a floating point number to an integer
// and print it to the screen
$round = round(M_PI);
echo $round
?>
</p>
<p>
<?php
// Try rounding a floating point number to 3 decimal places
// and print it to the screen
$test = round(M_PI, 3);
echo $test
?>
Answer 516f1c44ad5643e38f001091
2 votes
The variable $rounddecimal isn’t equal to $round_decimal
3 comments
William Gao almost 11 years
Even if I fix it, it still gives me the error message
brennanpringle_4f151ba89c99ab000101854f_deleted over 10 years
You’re also missing the underscore for the M_PI constant in the $rounddecimal variable.
Carlos Cañellas Tovar over 9 years
He’s not forgetting. Notice the italic that’s made with underlines.
Answer 516e760bbb9934d02a004a72
1 vote
When you print your round decimal you have added an underscore to the variable name. Does that fix it?
Answer 5173dde7ff3395e90500177a
0 votes
Never mind, I should have put 3 instead of two
Answer 5170f501de5021c0f4001af6
1 comments
William Gao almost 11 years
It still says Oops, try again! Your second call to round() should print a floating point number with exactly 3 digits after the decimal.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
3 comments
THX
Thank you! So that’s the problem with being two PHP.
And the exercise only uses one. Please, somebody fix it.