double類型如何限制精度

簡單的來說,我想把某一個double的值限制在小數點後的位數 能夠使用 DecimalFormat df = new DecimalFormat( "0.0000 "); double d = 1.0; System.out.println(df.format(d));
相關文章
相關標籤/搜索