+ 1
How Can I remove decimal in Java Calculator?
Already solved thanks :)
4 Respostas
+ 2
You don‘t want have decimal places in the result then why do you took the double input. You could read integer numbers, just from the beginning.
Otherwise you can convert the double to integer number.
+ 1
Whats the code if Im gonna convert the double to integer number?
+ 1
Nicee I already solved my problem thanks to you @JaScript ^^
+ 1
For this conversion are more ways, ie such as:
Using TypeCasting:
(int)mydouble;
Using Double.intValue() method:
Double mynewdouble = new Double(mydouble);
mynewdouble.intValue();
Using Math.round() method:
(int)Math.round(mydouble);