计算大数的百分比

huangapple 未分类评论69阅读模式
英文:

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;

huangapple
  • 本文由 发表于 2020年8月15日 02:39:21
  • 转载请务必保留本文链接:https://java.coder-hub.com/63418381.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定