Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rounding to 1 decimal place.

807598Dec 14 2005 — edited Dec 14 2005
Hello again.

I have a method called "findTheAverage" which takes in an array of integers as a parameter and then calculates and returns the average as a float.


What I want to do now though is create another method called "roundTheAverage" which takes in the float average variable from the previous method, rounds it to one decimal place, and then returns it as a float called roundedAverage.


Could anybody help me in achieving this?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2006
Added on Dec 14 2005
15 comments
402 views