如何将小数位数舍入为5,将零位置保留在第五位

0 java

显示0.45550我将它舍入为

double dis=0.455504673; 
double roundoff=Math.round(dis*100000.0)/100000.0;
System.out.println(roundoff);
Run Code Online (Sandbox Code Playgroud)

我的输出是0.4555,但我需要它作为0.45550 PLZ帮助我知道如何添加偶数为零输出

And*_*rea 5

使用DecimalFormat:

DecimalFormat df = new DecimalFormat("#.00000");
double dis=0.455504673;
System.out.print(df.format(dis));
Run Code Online (Sandbox Code Playgroud)