So guys, I was "futucando" in java, but I had a question. How do I format a number that is in a method?
For example:
Code snippet:
JOptionPane.showMessageDialog(null,brand+ "Saldo atual de " +cliente1.getID()+" :"
+ "\n"+cliente1.getBalance());
This code prints in the format 0000.0 but I wanted to remove this last decimal place, I already tried using % .f and % .db , but it did not work!
How do I get this .0 view?
Note: The getBalance
method is a common method of a private double.