更新时间:2023-02-11 08:48:25
将其转换为浮动然后执行:
cast it to float and then do it:
int i = 56472201;
float j = ((float) i)/1000000.0
编辑:由于精度(在您的情况下需要),请使用double。同样如Konrad Rudolph指出的那样,不需要显式投射:
Due to precision(needed in your case), use double. Also as pointed by Konrad Rudolph, no need for explicit casting:
double j = i / 1000000.0;