英文:
Calculate percent of big numbers
问题
我想计算 8000000 中的 17000 的百分比。结果应为 0.2125,但我总是得到 0.0。
我的代码:
double result = 17000 / 8000000 * 100;
英文:
I want to calculate the percent from 8000000 of 17000. The result should be 0.2125 but I'm getting always 0.0
My code
double result = 17000/8000000*100;
专注分享java语言的经验与见解,让所有开发者获益!
评论