id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

abraskin@mbusd.org > round
prev  |  next  |  chance

Given a double value and a number representing how many decimal places it should be rounded to, return the rounded result.
For example, if the second parameter is 0 then you would get a number rounded to the nearest whole number, a 2 gives your a number rounded to the hundredth place while a -2 give you the number rounded to the nearest 100.


round(15.5555, 0) → 16.0
round(15.49555, 0) → 15.0
round(15.99555, 0) → 16.0

...Save, Compile, Run (ctrl-enter)

public double round(double value, int place) }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy