String类型数字始终保留两位小数

public static void main(String[] args) {    
    DecimalFormat format = new DecimalFormat("0.00");
    String abc ="100.456";
    String a = format.format(new BigDecimal(abc));
    System.out.println(a);
    }

相关文章:

  • 2021-10-23
  • 2021-11-18
  • 2021-12-18
  • 2021-08-14
  • 2021-11-18
猜你喜欢
  • 2021-08-10
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案