Question: In Exercise 7.2, you modified the round.html page so that it rounded the number to two decimal places instead of 1. This involved multiplying the

In Exercise 7.2, you modified the round.html page so that it rounded the number to two decimal places instead of 1. This involved multiplying the number by 100 (instead of 10), rounding to the nearest integer, then dividing by 100 (instead of 10). This process can be generalized to any number of decimal places, by using the appropriate power of 10. In order to round a number to N digits, you multiply that number by 10N, round to the nearest integer, then divide by 10N.

Modify your round.html page so that it has an additional text box where the user can specify the number of digits. When the button is clicked, the number in the original text box will be rounded to the specified number of digits and displayed in the page?

Step by Step Solution

3.45 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Number Rounder function RoundIt Assumes numberBox contains a numbe... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

1409-C-S-O-S(989).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!