I have these two variables
double num = 540.512
double sum = 1978.8
Then I did this expression
double total = Math.round((num/ sum * 100) * 10) / 10;
but I end up with 27.0.
In fact I have many other variables and when I use them in the expression I always get a 0 in the tenth's place.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…