Possible error?


#1


https://www.codecademy.com/courses/web-beginner-en-7I7Xm/0/4?curriculum_id=5124ef4c78d510dd89003eb8


Can anyone help? I don't know if there's something wrong with my code or if there's a problem with the course, but in Math Functions 1, whenever I run my code, I receive an error message saying, "Oops, try again. Your second call to round() should print a floating point number with exactly 3 digits after the decimal."


<html>
    <p>
    <?php
    // Try rounding a floating point number to an integer
    // and print it to the screen
    print round(7.6);
    ?>
    </p>
    <p>
    <?php
    // Try rounding a floating point number to 3 decimal places
    // and print it to the screen
    print round(3.4318);
    ?>
    </p>
</html>


#2

Hi this line

    // Try rounding a floating point number to 3 decimal places
    // and print it to the screen
    print round(3.4318);

read well the comment you should print with 3 decimale so you should do it like that

    print round(3.4318, 3);

#3

Oh, thank you. I never realized that before!


#4

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