in my code i use integers multiplied by 100 as decimals (0.1 is 10 etc). Can you help me to format output to show it as decimal?
I would say to use 0.00
as format:
int myNumber = 10;
DecimalFormat format = new DecimalFormat("0.00");
System.out.println(format.format(myNumber));
It will print like:
10.00
The advantage here is:
If you do like:
double myNumber = .1;
DecimalFormat format = new DecimalFormat("0.00");
System.out.println(format.format(myNumber));
It will print like:
0.10