Beginning Java Programming 4 Math Rounding and Types

Published: 09 October 2020
on channel: JavaTutorialsSVS
233
1

This video uses a class provided to my students to assist with rounding. For those following with out that, you need to add the following code to your program. Paste this outside your main method. When you see an example that uses "Round.roundToDecimals(...", you can now just type "roundToDecimals(...".

public static double roundToDecimals(double d, int c) {
long temp=(int)Math.round(d*Math.pow(10,c));
return (((double)temp)/Math.pow(10,c));
}


On this page of the site you can watch the video online Beginning Java Programming 4 Math Rounding and Types with a duration of hours minute second in good quality, which was uploaded by the user JavaTutorialsSVS 09 October 2020, share the link with friends and acquaintances, this video has already been watched 233 times on youtube and it was liked by 1 viewers. Enjoy your viewing!