Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
JAVA Simple Calculator remove decimal places
Can anyone teach me how to remove decimal places if the answer is a whole number?
3 Respostas
+ 1
FOLLOW ME
You can convert theĀ doubleĀ value into aĀ intvalue.Ā int x = (int) yĀ where y is your double variable. Then, printingĀ xĀ does not give decimal places (15000Ā instead ofĀ 15000.0).
+ 1
ill try . thanks for your help ā¤ļø
0
great . thanks for your help