/**
     * double 类型取后面N位小数 N自定义.
     * @param nodesTemp
     * @return
     */
    public static String getNumDouble(double dou, int num) {
        String retValue = null;
        DecimalFormat df = new DecimalFormat();
        df.setMinimumFractionDigits(0);
        df.setMaximumFractionDigits(num);
        retValue = df.format(dou);
        retValue = retValue.replaceAll(",", "");
        return retValue;
    }

相关文章:

  • 2021-10-24
  • 2022-01-13
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
相关资源
相似解决方案