String类型数字始终保留两位小数 Post author:xfxia Post published:2023年8月25日 Post category:其他 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); } 你可能也喜欢 深度学习Course2第二周Optimization Algorithms习题整理 求100~200之间的素数(C语言) pm2基本使用 如何将本地项目与远程仓库git连接 SDUT-1180 C语言实验——单词统计 spring-data-mongodb 和spring 版本不兼容导致的错误 互斥锁 (mutex) WEB安全测试要点总结 (原创)RadioButton设置setChecked(true)的异常 通过stream流统计数据(多种方式) Android开发笔记:RecyclerView(二)刷新与点击事件 2020.10.12–PS–制作图章、抽出滤镜、消失点 使用Memory Analyzer分析内存溢出问题(分析hprof文件) Git可视化极简易教程 — Git GUI使用方法 VMWare centOS虚拟机黑屏 NBMA实验报告 P1006 [NOIP2008 提高组] 传纸条 OpenSchema 方法 目标检测和语义分割常用的数据增强(代码) RabbitMQ非root用户安装