|
Help with convert a double type number
Hi, Is there a way in Java that I can convert a double type number such as 3.1111111111222 to only two decimal places? So it would be as 3.11 only?
Another question is how to do Stop a method from running in Java Code?
For example.. I'm doing a loop.. and a user input a 'char' type.
If it's match, it stop execute, other while it keeps going.
I know have to use input, and if and else statement.
Which I already did.. But I need a method to stop from running.
Thanks.
|